http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60382
Bug ID: 60382
Summary: ICE on valid code at -O3 on x86_64-linux-gnu (in
vect_create_epilog_for_reduction, at
tree-vect-loop.c:4352)
Product: gcc
Version: unknown
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 also seems to affect the current 4.8 branch, but not GCC 4.8.2.
$ 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 20140301 (experimental) [trunk revision 208241] (GCC)
$
$ gcc-trunk -O2 small.c; a.out
$ gcc-4.8.2 -O3 small.c; a.out
$
$ gcc-trunk -O3 small.c
small.c: In function ‘foo’:
small.c:4:1: internal compiler error: in vect_create_epilog_for_reduction, at
tree-vect-loop.c:4495
foo ()
^
0xb66aa1 vect_create_epilog_for_reduction
../../gcc-trunk/gcc/tree-vect-loop.c:4493
0xb64c04 vectorizable_reduction(gimple_statement_base*, gimple_stmt_iterator*,
gimple_statement_base**, _slp_tree*)
../../gcc-trunk/gcc/tree-vect-loop.c:5344
0xb5656a vect_transform_stmt(gimple_statement_base*, gimple_stmt_iterator*,
bool*, _slp_tree*, _slp_instance*)
../../gcc-trunk/gcc/tree-vect-stmts.c:7226
0xb5acee vect_transform_loop(_loop_vec_info*)
../../gcc-trunk/gcc/tree-vect-loop.c:6054
0xb78f6b vectorize_loops()
../../gcc-trunk/gcc/tree-vectorizer.c:476
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, e, f;
void
foo ()
{
for (b = 0; b < 3; b++)
if (e)
{
for (c = 0; c < 4; c++)
{
if (b)
continue;
f = 1;
for (a = 0; a < 2; a++)
f |= 1;
}
for (;;)
;
}
}
int
main ()
{
foo ();
return 0;
}