-----------------------------------------------------------------------------------------
/* { dg-options "-O1 -funswitch-loops" } */
extern int bar (void);
void foo (int c, int b)
{
retry:
switch (c)
{
case 1: return;
case 2:
if (b)
c = bar ();
if (c != 3)
goto retry;
break;
}
}
-----------------------------------------------------------------------------------------
Program received signal SIGSEGV, Segmentation fault.
tree_verify_flow_info () at ../../gcc/gcc/tree-cfg.c:3727
3727 gcc_assert (!label_bb->aux || label_bb->aux == (void
*)1);
(gdb) where
#0 tree_verify_flow_info () at ../../gcc/gcc/tree-cfg.c:3727
#1 0x083c0793 in verify_flow_info () at ../../gcc/gcc/cfghooks.c:212
#2 0x080b8dba in cleanup_tree_cfg () at ../../gcc/gcc/tree-cfg.c:890
#3 0x080cbe52 in execute_pass_list (pass=0x853bd00) at
../../gcc/gcc/tree-optimize.c:508
#4 0x080cbe65 in execute_pass_list (pass=0x853bf80) at
../../gcc/gcc/tree-optimize.c:546
#5 0x080cbe65 in execute_pass_list (pass=0x853b6c0) at
../../gcc/gcc/tree-optimize.c:546
#6 0x080cc0a9 in tree_rest_of_compilation (fndecl=0xb7b279f8) at
../../gcc/gcc/tree-optimize.c:640
#7 0x08061d23 in c_expand_body (fndecl=0xb7b279f8) at
../../gcc/gcc/c-decl.c:6379
#8 0x083f0a5d in cgraph_expand_function (node=0xb7b27e0c) at
../../gcc/gcc/cgraphunit.c:822
#9 0x083f0bf8 in cgraph_assemble_pending_functions () at
../../gcc/gcc/cgraphunit.c:305
#10 0x083f126d in cgraph_finalize_function (decl=0xb7b279f8, nested=0 '\0') at
../../gcc/gcc/cgraphunit.c:388
#11 0x0806229c in finish_function () at ../../gcc/gcc/c-decl.c:6351
#12 0x0804b774 in yyparse () at c-parse.y:401
#13 0x0804fdfb in c_parse_file () at c-parse.y:2908
#14 0x08096cd6 in c_common_parse_file (set_yydebug=0) at
../../gcc/gcc/c-opts.c:1095
#15 0x0839cdbd in toplev_main (argc=0, argv=0x85e1451) at
../../gcc/gcc/toplev.c:985
#16 0xb7ed8ad8 in __libc_start_main (main=0x80a98d0 <main>, argc=5,
ubp_av=0xbffff594, init=0x8491fe0 <__libc_csu_init>, fini=0xb8000ca0
<_rtld_local_ro>, rtld_fini=0, stack_end=0xbffff58c) at
../sysdeps/generic/libc-start.c:209
#17 0x08049a91 in _start () at ../sysdeps/i386/elf/start.S:119
-----------------------------------------------------------------------------------------
--
Summary: [4.0 Regression] ICE Segmentation fault in
tree_verify_flow_info with -funswitch-loops
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: belyshev at lubercy dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18475