http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61042
Bug ID: 61042
Summary: ICE on valid code at -O3 on x86_64-linux-gnu
Product: gcc
Version: 4.10.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/4.10.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.10.0 20140502 (experimental) [trunk revision 210000] (GCC)
$
$ gcc-trunk -O2 -c small.c
$ gcc-4.9 -O3 -c small.c
$
$ gcc-trunk -O3 -c small.c
small.c: In function ‘foo’:
small.c:4:1: internal compiler error: Segmentation fault
foo ()
^
0x95c21f crash_signal
../../gcc-trunk/gcc/toplev.c:337
0x9b07d5 bb_predicate
../../gcc-trunk/gcc/tree-if-conv.c:149
0x9b07d5 is_predicated
../../gcc-trunk/gcc/tree-if-conv.c:275
0x9b07d5 is_cond_scalar_reduction
../../gcc-trunk/gcc/tree-if-conv.c:1442
0x9b07d5 predicate_scalar_phi
../../gcc-trunk/gcc/tree-if-conv.c:1583
0x9b07d5 predicate_all_scalar_phis
../../gcc-trunk/gcc/tree-if-conv.c:1637
0x9b07d5 combine_blocks
../../gcc-trunk/gcc/tree-if-conv.c:1954
0x9b178e tree_if_conversion
../../gcc-trunk/gcc/tree-if-conv.c:2108
0x9b178e execute
../../gcc-trunk/gcc/tree-if-conv.c:2187
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[1], d, f;
void
foo ()
{
for (; b; b++)
c[0] = c[f] && (d = a);
}