https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103721
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-12-14 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. Here is one which does not use pointers and inlining does not matter: int ipos = 0; int f (int world) { int searchVolume = world; int currentVolume = 0; while (currentVolume != searchVolume && searchVolume) { currentVolume = searchVolume; if (ipos != 0) searchVolume = 0; else searchVolume = 1; } return (currentVolume); } int main() { const int i = f (1111); __builtin_printf ("%d\n", (int)(i)); if (i != 1) __builtin_abort (); return 0; }