Commit 02fbae83 by Steven Bosscher Committed by Steven Bosscher

re PR c/18867 (ICE on invalid switch quantity)

        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.

testsuite/
        * gcc.dg/noncompile/20041207.c: New test.

From-SVN: r91837
parent 665fcad8
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
......
......@@ -6507,6 +6507,7 @@ c_start_case (tree exp)
{
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.
......
/* 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" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment