[Bug tree-optimization/101105] New: wrong code at -O3 on x86_64-linux-gnu
qrzhang at gatech dot edu
gcc-bugzilla@gcc.gnu.org
Thu Jun 17 03:44:52 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101105
Bug ID: 101105
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 11.
$ gcc-trunk -v
Configured with: ../gcc/configure --prefix=/nethome/qzhang414/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20210616 (experimental) [master revision
041f7417707:a530c589490:3155d51bfd1de8b6c4645dcb2292248a8d7cc3c9] (GCC)
$ gcc-trunk abc.c ; ./a.out
2
$ gcc-trunk -O3 abc.c ; ./a.out
Segmentation fault
$ cat abc.c
short a;
int b[5][4] = {2, 2};
long *c;
int d;
short(e)(f) { return f == 0 || a && f == 1 ? 0 : a; }
int main() {
int g, h;
g = 3;
for (; g >= 0; g--) {
h = 3;
for (; h >= 0; h--)
b[g][h] = b[0][1] && e(1);
}
d = b[0][1];
if (d)
*c = 4073709551611;
printf("%d\n", 2);
}
More information about the Gcc-bugs
mailing list