https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62238
Bug ID: 62238
Summary: ICE with LTO on valid code on x86_64-linux-gnu in
verify_ssa (in 64-bit mode)
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 (as
well as 4.9.x) with LTO on x86_64-linux-gnu in 64-bit mode (but not in 32-bit
mode).
It 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/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 20140823 (experimental) [trunk revision 214394] (GCC)
$
$ gcc-trunk -O0 -c fn1.c
$ gcc-trunk -O0 -c main.c
$ gcc-trunk -O3 *.o
$ ./a.out
$
$ gcc-4.8 -flto -O0 -c fn1.c
$ gcc-4.8 -flto -O0 -c main.c
$ gcc-4.8 -flto -O3 *.o
$ ./a.out
$
$ gcc-trunk -flto -O0 -c fn1.c
$ gcc-trunk -flto -O0 -c main.c
$ gcc-trunk -flto -O3 *.o
fn1.c: In function ‘fn1’:
fn1.c:4:1: error: missing definition
fn1 (int p)
^
for SSA_NAME: _73 in statement:
_32 = (unsigned int) _73;
fn1.c:4:1: internal compiler error: verify_ssa failed
0xab6be1 verify_ssa(bool, bool)
../../gcc-trunk/gcc/tree-ssa.c:1055
0x830f4b execute_function_todo
../../gcc-trunk/gcc/passes.c:1758
0x831a23 execute_todo
../../gcc-trunk/gcc/passes.c:1808
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: fatal error: gcc-trunk returned 1 exit status
compilation terminated.
/usr/bin/ld: fatal error: lto-wrapper failed
collect2: error: ld returned 1 exit status
$
$ cat fn1.c
int a[4], b, c, d;
int
fn1 (int p)
{
for (; d; d++)
{
unsigned int h;
for (h = 0; h < 3; h++)
{
if (a[c+c+h])
{
if (p)
break;
return 0;
}
b = 0;
}
}
return 0;
}
$ cat main.c
extern int fn1 (int);
int
main ()
{
fn1 (0);
return 0;
}
$