[Bug tree-optimization/34723] [4.7/4.8/4.9 Regression] Summing variable should be initialized to the first member before the loop
law at redhat dot com
gcc-bugzilla@gcc.gnu.org
Tue Dec 17 05:49:00 GMT 2013
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.
More information about the Gcc-bugs
mailing list