https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64087
Bug ID: 64087 Summary: ICE on valid code at -O3 on x86_64-linux-gnu in in lra_create_live_ranges, at lra-lives.c:1330 Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-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 on x86_64-linux-gnu in 64-bit mode (but not 32-bit mode). It is a regression from 4.9.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/5.0.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 5.0.0 20141126 (experimental) [trunk revision 218072] (GCC) $ $ gcc-trunk -m64 -O2 small.c; a.out $ gcc-trunk -m32 -O3 small.c; a.out $ gcc-4.9 -m64 -O3 small.c; a.out $ $ gcc-trunk -m64 -O3 small.c small.c: In function ‘main’: small.c:31:1: internal compiler error: in lra_create_live_ranges, at lra-lives.c:1330 } ^ 0x943b37 lra_create_live_ranges(bool, bool) ../../gcc-trunk/gcc/lra-lives.c:1330 0x92af7c lra(_IO_FILE*) ../../gcc-trunk/gcc/lra.c:2299 0x8e96e9 do_reload ../../gcc-trunk/gcc/ira.c:5391 0x8e96e9 execute ../../gcc-trunk/gcc/ira.c:5561 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. $ ------------------------------- int printf (const char *, ...); int a[72], b, c, d, e; int main () { int h; for (b = 0; b < 72; b++) { h = 1; if (b) h >>= 1; a[b] = h; } for (; e; e++) for (c = 0; c < 1;) for (; d;) { printf ("0"); int g; for (b = 0; b < 72; b++) { g = 1; if (b) g >>= 1; a[b] = g; } } return 0; }