https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72748
Bug ID: 72748
Summary: ICE on valid code at -O2 and -O3 with -g enabled in
64-bit mode on x86_64-linux-gnu: in simplify_subreg,
at simplify-rtx.c:5952
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
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
-O2 and -O3 with -g enabled on x86_64-linux-gnu in the 64-bit mode (but not in
the 32-bit mode).
It is a regression from 6.1.x, and has the same crash message as PR 71549,
which has been fixed.
$ 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/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160728 (experimental) [trunk revision 238811] (GCC)
$
$ gcc-trunk -m64 -O2 -c small.c
$ gcc-6.1 -m64 -O2 -g -c small.c
$
$ gcc-trunk -m64 -O2 -g -c small.c
small.c: In function ‘fn1’:
small.c:24:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:5952
}
^
0xbb03d2 simplify_subreg(machine_mode, rtx_def*, machine_mode, unsigned int)
../../gcc-source-trunk/gcc/simplify-rtx.c:5951
0xbb0939 simplify_gen_subreg(machine_mode, rtx_def*, machine_mode, unsigned
int)
../../gcc-source-trunk/gcc/simplify-rtx.c:6178
0xeb83cb vt_expand_loc_callback
../../gcc-source-trunk/gcc/var-tracking.c:8429
0x7ebed9 cselib_expand_value_rtx_1
../../gcc-source-trunk/gcc/cselib.c:1648
0x7ed8be cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
../../gcc-source-trunk/gcc/cselib.c:1530
0xeb8853 vt_expand_var_loc_chain
../../gcc-source-trunk/gcc/var-tracking.c:8324
0xeb8853 vt_expand_loc_callback
../../gcc-source-trunk/gcc/var-tracking.c:8486
0x7ebdf5 cselib_expand_value_rtx_1
../../gcc-source-trunk/gcc/cselib.c:1683
0x7ed8be cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
../../gcc-source-trunk/gcc/cselib.c:1530
0xeb8853 vt_expand_var_loc_chain
../../gcc-source-trunk/gcc/var-tracking.c:8324
0xeb8853 vt_expand_loc_callback
../../gcc-source-trunk/gcc/var-tracking.c:8486
0x7ed8be cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
../../gcc-source-trunk/gcc/cselib.c:1530
0xeb8853 vt_expand_var_loc_chain
../../gcc-source-trunk/gcc/var-tracking.c:8324
0xeb8853 vt_expand_loc_callback
../../gcc-source-trunk/gcc/var-tracking.c:8486
0x7ebdf5 cselib_expand_value_rtx_1
../../gcc-source-trunk/gcc/cselib.c:1683
0x7ed8be cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
../../gcc-source-trunk/gcc/cselib.c:1530
0xeb7439 vt_expand_var_loc_chain
../../gcc-source-trunk/gcc/var-tracking.c:8324
0xeb7439 vt_expand_1pvar
../../gcc-source-trunk/gcc/var-tracking.c:8599
0xeb7439 emit_note_insn_var_location(variable**, emit_note_data*)
../../gcc-source-trunk/gcc/var-tracking.c:8654
0xeba4aa traverse_noresize<emit_note_data*, emit_note_insn_var_location>
../../gcc-source-trunk/gcc/hash-table.h:950
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.
$
---------------------------------------
volatile int a;
int c, d, e, f, g, h;
int fn1 ()
{
int i;
for (; d;)
{
if (e)
break;
g = 0;
int j[4];
for (h = 0; h < 4; h++)
g++;
for (; c < 2; c++)
{
e = j[g];
i = j[0];
f = 4;
}
f |= d;
}
return a;
}