https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129064
Bug ID: 129064
Summary: GCC stuck in an infinite loop
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: arielmataev96 at gmail dot com
Target Milestone: ---
Hey,
When using gcc version 10 or above with "-O3" on the following code:
int f() {
int a0 = 0, a1 = 0;
int b0 = 0, b1 = 0;
int c0 = 0, c1 = 0;
for (int k = 0; k < 100; ++k) {
int na = a0 + 1, nb = b0 + 1, nc = c0 + 1;
a0 = a1; a1 = na;
b0 = b1; b1 = nb;
c0 = c1; c1 = nc;
}
return a0 + b0 + c0;
}
gcc gets stuck and eventually returns "Killed - processing time exceeded"
Reproduced in Compiler Explorer: https://godbolt.org/z/fhGd5jc4K