[Bug tree-optimization/93820] New: wrong code at -O3 on x86_64-linux-gnu
qrzhang at gatech dot edu
gcc-bugzilla@gcc.gnu.org
Wed Feb 19 07:17:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93820
Bug ID: 93820
Summary: wrong code at -O3 on x86_64-linux-gnu
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: qrzhang at gatech dot edu
Target Milestone: ---
It appears to be a regression in 9.x. Gcc-8.3 works fine.
Bisection points to: g:be43a8877e2f2f4590ba667b27a24a0cfdf8141d
$ gcc-trunk -v
gcc version 10.0.1 20200218 (experimental) [master revision
da67227bfc4:72b83cccb06:d4c10c9f4bff616e7ed07e92504fe31a700e2af1] (GCC)
$ gcc-trunk -O3 abc.c ; ./a.out
1
$ gcc-trunk abc.c ; ./a.out
0
$ cat abc.c
int printf(const char *, ...);
int a[10];
int b, d, h;
int *c = &b, *g;
short e;
int **f;
int ***i = &f;
void k() {
e = 5;
for (; e; e--) {
a[e + 4] = *c;
a[e + 2] = 0 != &d;
}
char j;
b = 0;
for (; b <= 5; b++) {
j = 0;
for (; j <= 5; j++)
a[j + 3] = 0;
}
for (;;) {
*i = &g;
*f = &h;
if (**i)
break;
int l = 9;
for (; l; l--)
a[l] = 0;
}
}
int main() {
k();
printf("%d\n", a[4]);
}
More information about the Gcc-bugs
mailing list