[Bug tree-optimization/78856] [6/7 Regression] wrong code at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes)
law at redhat dot com
gcc-bugzilla@gcc.gnu.org
Thu Dec 22 21:17:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78856
--- Comment #5 from Jeffrey A. Law <law at redhat dot com> ---
So what appears to be happening is we have two loops, one natural, and an inner
irreducible loop.
We have a potential jump thread that starts on outside the outer loop and
targets a block that is in the irreducible region. In essence it's crossing
two loop boundaries. The transformations we make are all valid, but we have
that pesky cached loop iteration information which is incorrect after that
transformation.
Interestingly enough the jump threader already tries to avoid this kind of
situation (crossing multiple loop boundaries) -- but it only does so for
natural loop boundaries. After reviewing the history of that code, there's a
good chance it was also working around the cached iteration information
problem. The best solution may be to improve the detection code and properly
invalidate rather than just suppress the jump thread. Still investigating.
More information about the Gcc-bugs
mailing list