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.