This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/58522] New: ICE with segfault at -O3 on x86_64-linux-gnu
- 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: Tue, 24 Sep 2013 20:28:24 +0000
- Subject: [Bug tree-optimization/58522] New: ICE with segfault at -O3 on x86_64-linux-gnu
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58522
Bug ID: 58522
Summary: ICE with segfault at -O3 on x86_64-linux-gnu
Product: gcc
Version: 4.9.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 at
-O3 on x86_64-linux in both 32-bit and 64-bit modes.
This 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/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure
--enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-checking=release
--with-gmp=/usr/local/gcc-trunk --with-mpfr=/usr/local/gcc-trunk
--with-mpc=/usr/local/gcc-trunk --with-cloog=/usr/local/gcc-trunk
--prefix=/usr/local/gcc-trunk
Thread model: posix
gcc version 4.9.0 20130924 (experimental) [trunk revision 202859] (GCC)
$
$ gcc-trunk -O2 small.c
$ gcc-4.8 -O3 small.c
$ gcc-trunk -O3 small.c
small.c: In function âmainâ:
small.c:13:1: internal compiler error: Segmentation fault
main ()
^
0x8108ef crash_signal
../../gcc-trunk/gcc/toplev.c:335
0x83b957 ssa_default_def(function*, tree_node*)
../../gcc-trunk/gcc/tree-dfa.c:310
0x83bcc0 get_or_create_ssa_default_def(function*, tree_node*)
../../gcc-trunk/gcc/tree-dfa.c:362
0x8569ec get_reaching_def
../../gcc-trunk/gcc/tree-into-ssa.c:1184
0x85ca82 maybe_replace_use
../../gcc-trunk/gcc/tree-into-ssa.c:1791
0x85ca82 rewrite_update_stmt
../../gcc-trunk/gcc/tree-into-ssa.c:1974
0x85ca82 rewrite_update_dom_walker::before_dom_children(basic_block_def*)
../../gcc-trunk/gcc/tree-into-ssa.c:2150
0xb99ed7 dom_walker::walk(basic_block_def*)
../../gcc-trunk/gcc/domwalk.c:176
0x85560c rewrite_blocks
../../gcc-trunk/gcc/tree-into-ssa.c:2209
0x85bce6 update_ssa(unsigned int)
../../gcc-trunk/gcc/tree-into-ssa.c:3294
0x9826bd insert_range_assertions
../../gcc-trunk/gcc/tree-vrp.c:6103
0x9826bd execute_vrp
../../gcc-trunk/gcc/tree-vrp.c:9572
0x9826bd execute
../../gcc-trunk/gcc/tree-vrp.c:9673
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.
$
-------------------------------------------
static int a, b;
char *c;
short *d, e;
int f;
short
foo (int p1, int p2)
{
return p2 >= 0 || p1 > 1 >> p2 ? p1 : p1 << p2;
}
int
main ()
{
int *g = &f, h;
for (b = 4; b; b--)
{
for (a = 0; a < 5; a++)
{
e = foo (h != 0, *d);
*g |= e;
*d = 0;
}
*c = 0;
}
return 0;
}