https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63941
Bug ID: 63941 Summary: ICE on valid code at -O3 and above on x86_64-linux-gnu Product: gcc Version: 5.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 on x86_64-linux-gnu in both 32-bit and 64-bit modes. 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 20141117 (experimental) [trunk revision 217671] (GCC) $ gcc-trunk -O2 -c small.c $ gcc-4.9 -O3 -c small.c $ $ gcc-trunk -O3 -c small.c small.c: In function ‘fn1’: small.c:4:1: internal compiler error: in add_to_predicate_list, at tree-if-conv.c:438 fn1 () ^ 0xb11044 add_to_predicate_list ../../gcc-trunk/gcc/tree-if-conv.c:438 0xb11044 add_to_dst_predicate_list ../../gcc-trunk/gcc/tree-if-conv.c:488 0xb11564 predicate_bbs ../../gcc-trunk/gcc/tree-if-conv.c:1155 0xb11c7a combine_blocks ../../gcc-trunk/gcc/tree-if-conv.c:2005 0xb13c06 tree_if_conversion ../../gcc-trunk/gcc/tree-if-conv.c:2162 0xb13c06 execute ../../gcc-trunk/gcc/tree-if-conv.c:2240 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 a, b, c, d[1], e, f, g, h; void fn1 () { char i = 0; for (b = 0; b >= 0;) for (b = 0; b < 2; b++) { d[f] && (e = 0); h = 1 & a - i ? 0 : a; c = i = h; char j = c; int k = 0; g = j || j > k; d[0] = 0; } }