https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71476

            Bug ID: 71476
           Summary: ICE in gimplify_switch_expr with -Wswitch-unreachable
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

void
foo (int a)
{
  switch (a)
    {
      void f (void) { break; }
    }
}

$ ./cc1 -quiet n.c  
n.c: In function ‘f’:
n.c:6:23: error: break statement not within loop or switch
       void f (void) { break; }
                       ^~~~~
n.c: In function ‘foo’:
n.c:4:3: internal compiler error: Segmentation fault
   switch (a)
   ^~~~~~
0xe453e0 crash_signal
        /home/marek/src/gcc/gcc/toplev.c:335
0xb04d2d gimple_code
        /home/marek/src/gcc/gcc/gimple.h:1674
0xb0a041 gimplify_switch_expr
        /home/marek/src/gcc/gcc/gimplify.c:1609
0xb30019 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/marek/src/gcc/gcc/gimplify.c:10556
0xb19669 gimplify_stmt(tree_node**, gimple**)
        /home/marek/src/gcc/gcc/gimplify.c:5731
0xb086d1 gimplify_bind_expr
        /home/marek/src/gcc/gcc/gimplify.c:1154
0xb2ffd7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/marek/src/gcc/gcc/gimplify.c:10548
0xb19669 gimplify_stmt(tree_node**, gimple**)
        /home/marek/src/gcc/gcc/gimplify.c:5731
0xb335fc gimplify_body(tree_node*, bool)
        /home/marek/src/gcc/gcc/gimplify.c:11532
0xb33e98 gimplify_function_tree(tree_node*)
        /home/marek/src/gcc/gcc/gimplify.c:11688
0x939f0b cgraph_node::analyze()
        /home/marek/src/gcc/gcc/cgraphunit.c:625
0x93b792 analyze_functions
        /home/marek/src/gcc/gcc/cgraphunit.c:1086
0x93fdb8 symbol_table::finalize_compilation_unit()
        /home/marek/src/gcc/gcc/cgraphunit.c:2543
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Reply via email to