https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71403

--- Comment #7 from Jeffrey A. Law <law at redhat dot com> ---
So, to follow-up on my own comment.  We start with 3 nested loops.  The first
backward jump threading pass threads the backedge of the outermost loop to the
head of the middle loop.

That essentially combines the loops -- where parts of the original middle loop
are not executed every iteration anymore.  But we have more total iterations. 
ISTM we need a way to invalidate most of what we know about the loop when this
happens.

Whether or not this is a good thing I think is open to debate.  It happens to
be good for this test as so much stuff collapses away, but I don't know if it's
typically a good thing in the real world or not.

Obviously we can avoid these problems by rejecting these jump threads --
essentially if the thread path starts out at some loop nesting X, if we ever
traverse into X+1, reject the path.  It's not ideal, but it's doable.

Reply via email to