http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34723
--- Comment #4 from Jeffrey A. Law <law at redhat dot com> --- The tree-ssa-threadupdate.c code seems to want to avoid threading to an empty loop latch block. No reason other than it was "useless" was given. But that's clearly wrong. We can easily have a loop where the header branches to either an empty latch block or to a point outside the loop. Threading from outside the loop to the empty latch effectively peels an iteration from the loop. I think this was just an oversight from Zdenek when he revamped the code in the tree-ssa-threadupdate to try and keep the loop structures up-to-date. Given that we allow threading to non-empty loop latches, threading to an empty loop latch should "just work". And fixing that appears to address this testcase. Testing in progress overnight.