[Bug tree-optimization/106114] [13 Regression] wrong code at -O1, -O2 and -O3 on x86_64-linux-gnu since r13-1268-g8c99e307b20c502e
zhendong.su at inf dot ethz.ch
gcc-bugzilla@gcc.gnu.org
Wed Jun 29 07:15:25 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106114
--- Comment #6 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
Two additional recent miscompiles that are likedly related:
(1)
[638] % gcctk -O0 small.c; ./a.out
[639] % gcctk -O1 small.c
[640] % ./a.out
Aborted
[641] % cat small.c
int a, b;
int main() {
int c = 0, d, e, f;
for (e = 0; e < 3; e++) {
f = a;
if (!b)
f = 1;
d = f;
}
if (d > 1 || d <= c)
__builtin_abort();
return 0;
}
(2)
[579] % gcctk -O1 small.c; ./a.out
[580] % gcctk -O2 small.c
[581] % timeout -s 9 5 ./a.out
Killed
[582] % cat small.c
int a, b, *c;
int f(int d, int e) { return !e || d && e == 1 ? 0 : d % e; }
int main() {
int g = -4, h = -3;
if (a)
h = b;
while (h <= g || h > -1)
;
if (f(1, a) > 3)
c = &h;
return 0;
}
More information about the Gcc-bugs
mailing list