https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102711
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2021-10-12 Ever confirmed|0 |1 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Just for refence this is the testcase that can be done at runtime: void exit(int); __attribute__((noipa)) int bar(void) { static int t = 0; t++; if (t == 2) exit(0); return 1; } __attribute__((noipa)) void foo(void) { if (!bar()) for (;;); for (;;) { static int flag = 0; int ret = 0; bar(); if (flag) { ret = bar(); if (!ret) ret = bar(); } flag = !bar(); if (!ret) bar(); } } int main(void) { foo(); }