https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105219
Bug ID: 105219
Summary: [12 Regression] SVE: Wrong code with -O3
-msve-vector-bits=128 -mtune=thunderx
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: acoplan at gcc dot gnu.org
Target Milestone: ---
The following C program appears to be miscompiled with -O3 -march=armv8.2-a+sve
-msve-vector-bits=128 -mtune=thunderx :
int a;
char b[60];
short c[18];
short d[4][19];
long long f;
void e(int g, int h, short k[][19]) {
for (signed i = 0; i < 3; i += 2)
for (signed j = 1; j < h + 14; j++) {
b[i * 14 + j] = 1;
c[i + j] = k[2][j];
a = g ? k[i][j] : 0;
}
}
int main() {
e(9, 1, d);
for (long l = 0; l < 6; ++l)
for (long m = 0; m < 4; ++m)
f ^= b[l + m * 4];
if (f)
__builtin_abort ();
}
Of course the choice of tuning is not sensible when asking for SVE, but GCC
shouldn't produce wrong code in any case. I can't reproduce the problem with
GCC 11.