This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/66691] New: ICE on valid code at -O3 with -g enabled in simplify_subreg, at simplify-rtx.c:5744
- From: "su at cs dot ucdavis.edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 28 Jun 2015 05:21:30 +0000
- Subject: [Bug target/66691] New: ICE on valid code at -O3 with -g enabled in simplify_subreg, at simplify-rtx.c:5744
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66691
Bug ID: 66691
Summary: ICE on valid code at -O3 with -g enabled in
simplify_subreg, at simplify-rtx.c:5744
Product: gcc
Version: 6.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
-O3 with -g enabled on x86_64-linux-gnu in 32-bit mode (but not in 64-bit
mode).
It also affects 5.1.x, thus 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/6.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 6.0.0 20150627 (experimental) [trunk revision 225100] (GCC)
$
$ gcc-trunk -m32 -O3 small.c; ./a.out
$ gcc-trunk -m32 -O2 -g small.c; ./a.out
$ gcc-trunk -m64 -O3 -g small.c; ./a.out
$ gcc-4.9 -m32 -O3 -g small.c; ./a.out
$
$ gcc-trunk -m32 -O3 -g small.c
small.c: In function âmainâ:
small.c:59:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:5744
}
^
0xb19a79 simplify_subreg(machine_mode, rtx_def*, machine_mode, unsigned int)
../../gcc-trunk/gcc/simplify-rtx.c:5744
0xb19cc9 simplify_gen_subreg(machine_mode, rtx_def*, machine_mode, unsigned
int)
../../gcc-trunk/gcc/simplify-rtx.c:5969
0xde472e vt_expand_loc_callback
../../gcc-trunk/gcc/var-tracking.c:8437
0x74b921 cselib_expand_value_rtx_1
../../gcc-trunk/gcc/cselib.c:1683
0x74c00e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
../../gcc-trunk/gcc/cselib.c:1565
0xde49d4 vt_expand_var_loc_chain
../../gcc-trunk/gcc/var-tracking.c:8332
0xde49d4 vt_expand_loc_callback
../../gcc-trunk/gcc/var-tracking.c:8494
0x74b9c2 cselib_expand_value_rtx_1
../../gcc-trunk/gcc/cselib.c:1718
0x74c00e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
../../gcc-trunk/gcc/cselib.c:1565
0xde53be vt_expand_var_loc_chain
../../gcc-trunk/gcc/var-tracking.c:8332
0xde53be vt_expand_1pvar
../../gcc-trunk/gcc/var-tracking.c:8607
0xde53be emit_note_insn_var_location(variable_def**, emit_note_data_def*)
../../gcc-trunk/gcc/var-tracking.c:8662
0xded88a void hash_table<variable_hasher,
xcallocator>::traverse_noresize<emit_note_data_def*,
&(emit_note_insn_var_location(variable_def**,
emit_note_data_def*))>(emit_note_data_def*)
../../gcc-trunk/gcc/hash-table.h:915
0xded88a void hash_table<variable_hasher,
xcallocator>::traverse<emit_note_data_def*,
&(emit_note_insn_var_location(variable_def**,
emit_note_data_def*))>(emit_note_data_def*)
../../gcc-trunk/gcc/hash-table.h:937
0xded88a emit_notes_for_changes
../../gcc-trunk/gcc/var-tracking.c:9022
0xdf30fb emit_notes_in_bb
../../gcc-trunk/gcc/var-tracking.c:9454
0xdf30fb vt_emit_notes
../../gcc-trunk/gcc/var-tracking.c:9515
0xdf3a26 variable_tracking_main_1
../../gcc-trunk/gcc/var-tracking.c:10368
0xdf3a26 variable_tracking_main()
../../gcc-trunk/gcc/var-tracking.c:10382
0xdf3a26 execute
../../gcc-trunk/gcc/var-tracking.c:10419
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.
$
-----------------------------------------------------
unsigned int a;
int b[2], c, d, e, f, g, h, i, k[8], l, m, s, t, w;
static int j;
void
fn1 (long long p)
{
int t = p;
c = c ^ b[c ^ (t & 1)];
}
static void
fn2 (long long p)
{
c = c ^ b[1 ^ (d & 1)];
fn1 (p >> 1 & 1);
fn1 (p >> 2);
}
static void
fn3 ()
{
unsigned char p;
f = g = 0;
for (h = 0; h < 6; h++)
{
for (s = 0; s < 7; s++)
if (k[s+1])
g = 0;
else
for (j = 0; j < 2; j++)
;
t = j > 2 ? 0 : 1 >> j;
}
if (l)
{
short q[2];
q[0] = q[1] = 0;
if (m)
for (i = 0; i < 2; i++)
{
unsigned char r = q[i];
p = f ? r % f : r;
e = ((p > 0) <= (q[i] ^ 1)) + a;
if (k[1])
for (e = 0; e != 18; ++e)
k[0] = 0;
}
}
}
int
main ()
{
fn3 ();
fn2 (w);
fn2 (j);
return 0;
}