https://gcc.gnu.org/bugzilla/show_bug.cgi?id=23855
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ysrumyan at gmail dot com --- Comment #30 from Richard Biener <rguenth at gcc dot gnu.org> --- Well, unfortunately it doesn't fully work for void bar(void); void foo(int ie, int je, int ke) { int i, j, k; for (k=0; k<ke; ++k) for (j=0; j<je; ++j) for (i=0; i<ie; ++i) bar(); } it hoists the header check one level but it doesn't manage to hoist the ie > 0 check all the way up out of the k loop. I suppose iterating find_loop_guard in some way would work. I have a patch in testing.