https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128704
Bug ID: 128704
Summary: ICE in superloop_at_depth, at cfgloop.cc:81 during
GIMPLE pass vect at -O2
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: shimizu2486 at gmail dot com
Target Milestone: ---
Live reproducer: https://godbolt.org/z/ca4zoM5j5
$ cat t1.c
char a[8];
void f(void) {
for (int i = 0; i < 5; i++)
for (unsigned char j = 0; j < 7; j++)
a[(i + j) & 7] = 0;
}
$ gcc -O2 -c t1.c
during GIMPLE pass: vect
t1.c: In function 'f':
t1.c:2:6: internal compiler error: in superloop_at_depth, at cfgloop.cc:81
2 | void f(void) {
| ^
x86-64 trunk (842e09f03b64) ICE
x86-64 16.2.0 compiles
-O2 ICEs; -O1, -O3 and -Os compile it, and so does -O2 with
-fno-tree-loop-vectorize. With an outer bound of 1, 2, 3, 4, 8 or 100 instead
of 5 it compiles; 6 ICEs too. arm-linux-gnueabihf -O2 ICEs the same way;
riscv64 and powerpc64le compile it.