Closed
Description
This code prints 1 at -Os and 0 at -O0/1/2/3:
int printf(const char *, ...);
long a, b = 208;
short c;
long(d)(long e) { return (a && e && 2036854775807 / e) * a; }
void f(long *e) {
if (d(c | (*e = b || 0)))
for (;;)
;
}
int main() {
long *g = &b;
*g = 0;
f(&b);
printf("%d\n", (int)b);
}
Compiler Explorer: https://godbolt.org/z/vPvna9s5Y