https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71132
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- So the issue is that loop distribution computes control dependences in the function once and queries them after processing some loops already (in this case removing a loop and replacing it with a builtin memset). In this case this leads to the loop header being control dependent on the exit test of the memset loop (sth that doesn't require the endless loop we have here).