* c-typeck.c (c_start_case): Set orig_type to error_mark_node
when the type of the controlling expression is not a valid type.
testsuite/
* gcc.dg/noncompile/
20041207.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91837
138bc75d-0d04-0410-961f-
82ee72b054a4
2004-12-07 Steven Bosscher <stevenb@suse.de>
+ PR c/18867
+ * c-typeck.c (c_start_case): Set orig_type to error_mark_node
+ when the type of the controlling expression is not a valid type.
+
+2004-12-07 Steven Bosscher <stevenb@suse.de>
+
PR tree-optimization/17340
* tree-ssa-pre.c (compute_antic): Fix comment.
(compute_avail): Do not recurse, instead do a DFS using a stack
{
error ("switch quantity not an integer");
exp = integer_zero_node;
+ orig_type = error_mark_node;
}
else
{
+2004-12-07 Steven Bosscher <stevenb@suse.de>
+
+ * gcc.dg/noncompile/20041207.c: New test.
+
2004-12-07 Volker Reichelt <reichelt@gcc.gnu.org>
* g++.dg/other/unreachable-1.C: New test.
--- /dev/null
+/* PR18867 - ICE on a switch controlling expressions with an
+ invalid type. Origin: Serge Belyshev <belyshev@lubercy.com> */
+
+void f()
+{
+ float x;
+ switch (x) {case 0: break;}; /* {dg-error "not an integer" } */
+}