https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81620
Bug ID: 81620
Summary: ICE on valid code at -O3 in both 32-bit and 64-bit
modes on x86_64-linux-gnu (small.c:3:5: internal
compiler error: in is_inv_store_elimination_chain, at
tree-predcom.c:1651)
Product: gcc
Version: unknown
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/8.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 8.0.0 20170730 (experimental) [trunk revision 250721] (GCC)
$ gcc-trunk -O3 small.c
during GIMPLE pass: pcom
small.c: In function ‘main’:
small.c:3:5: internal compiler error: in is_inv_store_elimination_chain, at
tree-predcom.c:1651
int main() {
^~~~
0xd25e10 is_inv_store_elimination_chain
../../gcc-source-trunk/gcc/tree-predcom.c:1651
0xd25e10 prepare_initializers_chain_store_elim
../../gcc-source-trunk/gcc/tree-predcom.c:2786
0xd25e10 prepare_initializers_chain
../../gcc-source-trunk/gcc/tree-predcom.c:2846
0xd25e10 prepare_initializers
../../gcc-source-trunk/gcc/tree-predcom.c:2901
0xd25e10 tree_predictive_commoning_loop
../../gcc-source-trunk/gcc/tree-predcom.c:3092
0xd25e10 tree_predictive_commoning()
../../gcc-source-trunk/gcc/tree-predcom.c:3170
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.
$ cat small.c
int a[7];
char b;
int main() {
b = 4;
for (; b; b--) {
a[b] = b;
a[b + 2] = 1;
}
return 0;
}
$