https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81165
--- Comment #9 from Alexandre Oliva <aoliva at gcc dot gnu.org> --- The reason dom doesn't duplicate the loop entry test is that the additional phi node grows it past the max-jump-thread-duplication-stmts limit. Compiling with --param max-jump-thread-duplication-stmts=16 we get rid of all of the loop.