https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68691
Bug ID: 68691
Summary: ICE at -O3 with -g enabled on x86_64-linux-gnu in
alter_subregs, at lra-spills.c:610 (in 32-bit mode)
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
Target Milestone: ---
The following code causes an ICE when compiled with the current gcc trunk at
-O3 with -g enabled on x86_64-linux-gnu in the 32-bit mode (but not in 64-bit
mode).
It is a regression from 5.2.x.
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-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 6.0.0 20151203 (experimental) [trunk revision 231219] (GCC)
$
$ gcc-trunk -m32 -O2 -g -c small.c
$ gcc-trunk -m64 -O3 -g -c small.c
$ gcc-5.2 -m32 -O3 -g -c small.c
$
$ gcc-trunk -m32 -O3 -g -c small.c
small.c: In function ‘fn1’:
small.c:39:1: internal compiler error: in alter_subregs, at lra-spills.c:610
}
^
0x9a4ccd alter_subregs
../../gcc-trunk/gcc/lra-spills.c:610
0x9a5f32 lra_final_code_change()
../../gcc-trunk/gcc/lra-spills.c:745
0x9868dc lra(_IO_FILE*)
../../gcc-trunk/gcc/lra.c:2383
0x93c449 do_reload
../../gcc-trunk/gcc/ira.c:5383
0x93c449 execute
../../gcc-trunk/gcc/ira.c:5554
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.
$
--------------------------------------
char a, b, i, j;
int c, d, e, f, g, h, n;
char
fn1 ()
{
char k, l, m;
int p;
e = g > f;
for (b = 0; b < 2; b++)
{
for (p = 0; p < 3; p++)
{
for (; h < 1; h++)
{
for (; m;)
goto lbl;
e = g;
}
l = a < 0 || a < d;
}
d++;
for (;;)
{
k = g;
n = -k;
j = n;
c = j;
e = 2;
if (l)
break;
return 2;
}
}
for (;;)
;
lbl:
return i;
}