http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60733
Bug ID: 60733 Summary: ICE by LTO on valid code at -O3 on x86_64-linux-gnu Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu The following code causes an ICE when compiled with the current gcc trunk at -O3 using LTO on x86_64-linux-gnu (in both 32-bit and 64-bit modes). This is a regression from 4.8.x. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk --enable-languages=c,c++ --disable-werror --enable-multilib Thread model: posix gcc version 4.9.0 20140401 (experimental) [trunk revision 208971] (GCC) $ $ gcc-trunk -O3 small.c; a.out $ gcc-4.8 -flto -O3 small.c; a.out $ $ gcc-trunk -flto -O3 small.c small.c: In function ‘main’: small.c:12:1: error: definition in block 10 follows the use main () ^ for SSA_NAME: _83 in statement: slsr_184 = _83 * 65535; small.c:12:1: internal compiler error: verify_ssa failed 0xa4b70b verify_ssa(bool) ../../gcc-trunk/gcc/tree-ssa.c:1096 0x7ee4fc execute_function_todo ../../gcc-trunk/gcc/passes.c:1854 0x7eee53 execute_todo ../../gcc-trunk/gcc/passes.c:1887 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. lto-wrapper: gcc-trunk returned 1 exit status /usr/bin/ld: fatal error: lto-wrapper failed collect2: error: ld returned 1 exit status $ --------------------------------- int a, d, e, f, g, h, i, j, k, l; unsigned short b; short fn1 (int p1, int p2) { return p1 * p2; } int main () { for (; a; a--) { int m = 0; if (h) { for (; i;) { h++; e = 0; for (;;) ; } for (; m != -6; m--) { int n[] = {}; k = fn1 (b--, d); for (g = 0; g; g = 1) ; l = e ? n[0] : 0; f ^= 1; } j = 0; for (;;) ; } } d = 0; return 0; }