[Bug middle-end/17657] [4.0 Regression] ICE in expand_case

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Oct 4 04:15:00 GMT 2004


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-04 04:15 -------
But that does not matter because I can reproduce the failure with both the C and C++ front-end with:
extern int foo (int);
void
bar (void)
{
  signed char tmp = foo (0);
  int t1 = tmp;
  switch (t1)
    {
    case 1: foo (1); break;
    case 2: foo (2); break;
    case 3: foo (3); break;
    case 4: foo (4); break;
    case 5: foo (5); break;
    case 6: foo (6); break;
    case 7: foo (7); break;
    case 255: foo (8); break;
    default: break;
    }
}
: Search converges between 2004-07-20-trunk (#491) and 2004-07-21-trunk (#492).

Which was caused by:
2004-07-20  Steven Bosscher  <stevenb@suse.de>

        * c-common.h (check_case_value): Remove prototype.
        (c_add_case_label): Adjust prototype.
        * c-common.c (check_case_value): Make static.
        (check_case_bounds): New function.
        (c_add_case_label): Use it.  Take new argument orig_type.
        * c-typeck.c (struct c_switch): New orig_type field.
        (c_start_case): Set it.
        (do_case): Pass it to c_add_case_label.
        * expr.c (expand_expr_real_1): Don't warn for out-of-bounds
        cases from here.  Add the labels in reverse order.
        * stmt.c (struct case_node): Adjust comment.  Remove balance field.
        (add_case_node): Return nothing, don't check for duplicate cases.
        Insert new case nodes in a list, not in an AVL tree.
        (expand_end_case_type): Don't turn a case tree into a case list.
        (case_tree2list): Remove.
        * tree.h (add_case_node): Adjust prototype.

Steven you remove the code to reject the case statements which was importrant for the testcase above 
and now the C++ testcase,  could you fix this?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steven at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17657



More information about the Gcc-bugs mailing list