https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71462
Bug ID: 71462 Summary: gcc ICE at -O3 on valid code on x86_64-linux-gnu with “seg fault” Product: gcc Version: 7.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 valid code causes an ICE when compiled with the current gcc trunk at -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. It appears to be a 7 regression. $ 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/7.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 7.0.0 20160608 (experimental) [trunk revision 237212] (GCC) $ gcc-trunk -O3 abc.c abc.c: In function ‘fn1’: abc.c:3:6: internal compiler error: Segmentation fault void fn1() { ^~~ 0xb635cf crash_signal ../../gcc/gcc/toplev.c:335 0xcbe6bb ei_container ../../gcc/gcc/basic-block.h:393 0xcbe6bb ei_end_p ../../gcc/gcc/basic-block.h:429 0xcbe6bb ei_cond ../../gcc/gcc/basic-block.h:479 0xcbe6bb find_uses_to_rename_bb ../../gcc/gcc/tree-ssa-loop-manip.c:442 0xcc0a5e find_uses_to_rename ../../gcc/gcc/tree-ssa-loop-manip.c:476 0xcc0a5e rewrite_into_loop_closed_ssa_1(bitmap_head*, unsigned int, int, loop*) ../../gcc/gcc/tree-ssa-loop-manip.c:642 0xca5b30 tree_unroll_loops_completely(bool, bool) ../../gcc/gcc/tree-ssa-loop-ivcanon.c:1388 0xca6030 execute ../../gcc/gcc/tree-ssa-loop-ivcanon.c:1531 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 short a; long b; void fn1() { int c = a = 1; for (; a; a++) { for (; 9 <= 8;) for (;;) { a = 20; for (; a <= 35; a++) ; line:; } if ((c += 264487869) == 9) { unsigned *d = 0; for (; b;) d = (unsigned *)&c; if (d) for (;;) ; } } goto line; }