https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99101
--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> --- Further simplified, but still depends on -ffinite-loops volatile int xx; int main() { int jobs_ = 1; int at_eof_ = 0; while (1) { for (int i = 0; i < jobs_; i++) { if (at_eof_) continue; at_eof_ = 1; __builtin_printf ("1\n"); if (xx) return 1; } jobs_ = 0; } return 0; } if one exchanges the at_eof_ test with a function call like if (at_eof ()) then the side-effect of at_eof() marks the if necessary by means of the block being control dependent on itself.