https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78429
Bug ID: 78429
Summary: ice on valid C code on x86_64-linux-gnu at -O3 in both
32-bit and 64-bit modes (internal compiler error: in
set_value_range, at tree-vrp.c:361)
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: chengniansun at gmail dot com
Target Milestone: ---
$ 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 20161119 (experimental) [trunk revision 242629] (GCC)
$
$ gcc-trunk small.c -O3
small.c: In function ‘main’:
small.c:6:5: internal compiler error: in set_value_range, at tree-vrp.c:361
int main() {
^~~~
0xe7fe08 set_value_range
../../gcc-source-trunk/gcc/tree-vrp.c:360
0xe85ce7 set_and_canonicalize_value_range
../../gcc-source-trunk/gcc/tree-vrp.c:1527
0xe85ce7 extract_range_for_var_from_comparison_expr
../../gcc-source-trunk/gcc/tree-vrp.c:1579
0xe96cbd extract_range_from_assert
../../gcc-source-trunk/gcc/tree-vrp.c:1777
0xe96cbd extract_range_from_assignment
../../gcc-source-trunk/gcc/tree-vrp.c:4144
0xe978d0 vrp_visit_assignment_or_call
../../gcc-source-trunk/gcc/tree-vrp.c:7115
0xe978d0 extract_range_from_stmt
../../gcc-source-trunk/gcc/tree-vrp.c:7903
0xe98e94 vrp_visit_stmt
../../gcc-source-trunk/gcc/tree-vrp.c:7924
0xd9b73e simulate_stmt
../../gcc-source-trunk/gcc/tree-ssa-propagate.c:241
0xd9d1f7 simulate_block
../../gcc-source-trunk/gcc/tree-ssa-propagate.c:375
0xd9d1f7 ssa_propagate(ssa_prop_result (*)(gimple*, edge_def**, tree_node**),
ssa_prop_result (*)(gphi*))
../../gcc-source-trunk/gcc/tree-ssa-propagate.c:808
0xe8e881 execute_vrp
../../gcc-source-trunk/gcc/tree-vrp.c:11204
0xe8e881 execute
../../gcc-source-trunk/gcc/tree-vrp.c:11291
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.
$
$ cat small.c
int a[6];
char b;
unsigned c;
short d;
volatile int e;
int main() {
int f;
for (; c <= 2; c++) {
d = 3;
for (; d >= 0; d--) {
int g = b;
f = a[d] || b;
}
f || e;
}
return 0;
}