https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83695
Bug ID: 83695
Summary: ICE on valid code at -O3: Segmentation fault
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: su at cs dot ucdavis.edu
Target Milestone: ---
This appears to be a recent regression.
$ gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.0 20180105 (experimental) [trunk revision 256272] (GCC)
$
$ gcctk -O2 small.c
$ gcc-7.2.0 -O3 small.c
$
$ gcctk -O3 small.c
during GIMPLE pass: linterchange
small.c: In function ‘main’:
small.c:15:5: internal compiler error: Segmentation fault
int main ()
^~~~
0xc8fd6f crash_signal
../../gcc-source-trunk/gcc/toplev.c:325
0xd89984 instantiate_scev_r
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:2720
0xd89e6b instantiate_scev_convert
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:2611
0xd89e6b instantiate_scev_r
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:2747
0xd8a7f5 instantiate_scev(edge_def*, loop*, tree_node*)
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:2806
0xe1dc46 instantiate_parameters
../../gcc-source-trunk/gcc/tree-scalar-evolution.h:63
0xe1dc46 infer_loop_bounds_from_signedness
../../gcc-source-trunk/gcc/tree-ssa-loop-niter.c:3498
0xe1dc46 infer_loop_bounds_from_undefined
../../gcc-source-trunk/gcc/tree-ssa-loop-niter.c:3561
0xe22854 estimate_numbers_of_iterations(loop*)
../../gcc-source-trunk/gcc/tree-ssa-loop-niter.c:3943
0xe2425f estimate_numbers_of_iterations(loop*)
../../gcc-source-trunk/gcc/tree-ssa-loop-niter.c:4427
0xe2425f loop_exits_before_overflow
../../gcc-source-trunk/gcc/tree-ssa-loop-niter.c:4328
0xe24760 scev_probably_wraps_p(tree_node*, tree_node*, tree_node*, gimple*,
loop*, bool)
../../gcc-source-trunk/gcc/tree-ssa-loop-niter.c:4580
0x1502ec7 convert_affine_scev(loop*, tree_node*, tree_node**, tree_node**,
gimple*, bool, tree_node*)
../../gcc-source-trunk/gcc/tree-chrec.c:1262
0x1503424 chrec_convert_1
../../gcc-source-trunk/gcc/tree-chrec.c:1348
0xd8bf27 interpret_rhs_expr
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:1930
0xd88dfe interpret_gimple_assign
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:2002
0xd88dfe analyze_scalar_evolution_1
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:2051
0xd88b1e analyze_scalar_evolution_1
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:2039
0xd896b9 analyze_scalar_evolution(loop*, tree_node*)
../../gcc-source-trunk/gcc/tree-scalar-evolution.c:2111
0xe1dc29 infer_loop_bounds_from_signedness
../../gcc-source-trunk/gcc/tree-ssa-loop-niter.c:3498
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$
------------------------------------
int a[3][3][3], b, d;
short c;
unsigned char e;
static void f ()
{
for (c = 0; c < 2; c++)
for (e = 0; e < 3; e++)
for (b = 0; b < 3; b++)
a[b][e][b] = 0;
while (1)
;
}
int main ()
{
if (d)
f ();
return 0;
}