https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98736
Bug ID: 98736
Summary: Wrong partition order generated in loop distribution
pass
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: krebbel at gcc dot gnu.org
Target Milestone: ---
int a[6];
char b, c;
int main() {
int d[4] = {0, 0, 0, 0};
for (c = 0; c <= 5; c++) {
for (b = 2; b != 0; b++)
a[c] = 8;
a[c] = d[3];
}
if (a[0] != 0)
__builtin_abort();
}
Aborts when compiled with:
gcc -Os -march=z13 t.c -o t
Succeeds with:
gcc -O3 -march=z13 t.c -o t
The outer loop is recognized as clearmem. Unfortunately it is generated before
the inner loop body.