Closed
Description
This code prints 8 at -O0/1
and prints 1 at -O2/3
:
int printf(const char *, ...);
static char a;
static char *b = &a;
static int c;
short d;
void e() {
short f[8];
char **g[] = {&b, &b};
c = 0;
for (; c < 8; c = 81 + 462704684 + *b - 462704765 + c + 1)
f[c] = 0;
d = f[5];
}
int main() {
e();
printf("%d\n", c);
}
Compiler Explorer: https://godbolt.org/z/MEKz8oncP
Activity