This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/71403] [7 Regression] wrong code (segfault) at -O3 on x86_64-linux-gnu
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 13 Jun 2016 06:25:38 +0000
- Subject: [Bug tree-optimization/71403] [7 Regression] wrong code (segfault) at -O3 on x86_64-linux-gnu
- Auto-submitted: auto-generated
- References: <bug-71403-4 at http dot gcc dot gnu dot org/bugzilla/>
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.