http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58344
Bug ID: 58344
Summary: ICE with segfault at -O1 and above on x86_64-linux-gnu
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
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
-O1 and above on x86_64-linux (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
--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 20130906 (experimental) [trunk revision 202308] (GCC)
$ gcc-trunk -O0 -c small.c
$ gcc-4.8 -O1 -c small.c
$ gcc-trunk -O1 -c small.c
small.c: In function ‘foo’:
small.c:9:7: internal compiler error: Segmentation fault
bar (a[0]);
^
0x924b2f crash_signal
../../gcc-trunk/gcc/toplev.c:335
0x6daba0 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**)
../../gcc-trunk/gcc/expr.c:9758
0x5fc8ca expand_expr
../../gcc-trunk/gcc/expr.h:444
0x5fc8ca store_one_arg
../../gcc-trunk/gcc/calls.c:4502
0x6024f2 expand_call(tree_node*, rtx_def*, int)
../../gcc-trunk/gcc/calls.c:3042
0x6dbc2e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**)
../../gcc-trunk/gcc/expr.c:10234
0x612b6f expand_call_stmt
../../gcc-trunk/gcc/cfgexpand.c:2180
0x612b6f expand_gimple_stmt_1
../../gcc-trunk/gcc/cfgexpand.c:2218
0x612b6f expand_gimple_stmt
../../gcc-trunk/gcc/cfgexpand.c:2370
0x6139b3 expand_gimple_basic_block
../../gcc-trunk/gcc/cfgexpand.c:4204
0x61557c gimple_expand_cfg
../../gcc-trunk/gcc/cfgexpand.c:4723
0x61557c execute
../../gcc-trunk/gcc/cfgexpand.c:4937
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.
$
-----------------------------------
struct U {};
static struct U a[1];
extern void bar (struct U);
void foo ()
{
bar (a[0]);
}