https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69214
Bug ID: 69214 Summary: ICE (segfault) at -Os on x86_64-linux-gnu in "fail_abnormal_edge_coalesce" Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: helloqirun at gmail dot com Target Milestone: --- The following code causes an ICE when compiled with the current gcc trunk at -Os on x86_64-linux-gnu in 64-bit mode. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 6.0.0 20160109 (experimental) [trunk revision 232190] (GCC) $ gcc-trunk -c -Os abc.c Unable to coalesce ssa_names 2 and 17 which are marked as MUST COALESCE. d_2(ab) and d_17(ab) abc.c: In function 'foo': abc.c:8:6: internal compiler error: SSA corruption void foo (struct A *x) ^~~ 0xc3eb26 fail_abnormal_edge_coalesce ../../gcc/gcc/tree-ssa-coalesce.c:936 0xc3eb26 coalesce_partitions ../../gcc/gcc/tree-ssa-coalesce.c:1337 0xc3eb26 coalesce_ssa_name() ../../gcc/gcc/tree-ssa-coalesce.c:1821 0xbcf7d0 remove_ssa_form ../../gcc/gcc/tree-outof-ssa.c:974 0xbcf7d0 rewrite_out_of_ssa(ssaexpand*) ../../gcc/gcc/tree-outof-ssa.c:1198 0x747ad0 execute ../../gcc/gcc/cfgexpand.c:6124 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. --------- $ cat abc.c extern int setjmp (int); extern int fun1 (int); extern int *fun2 (void); struct A {unsigned a;}; void foo (struct A *x) { int d = 0; long f = 0; setjmp (*fun2()); f = d; d = 8; ((x->a) && !f && fun1 (d)); }