This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/58387] [4.9 Regression] wrong code at -Os and above on x86_64-linux-gnu (both 32-bit and 64-bit modes)
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 13 Sep 2013 06:02:07 +0000
- Subject: [Bug middle-end/58387] [4.9 Regression] wrong code at -Os and above on x86_64-linux-gnu (both 32-bit and 64-bit modes)
- Auto-submitted: auto-generated
- References: <bug-58387-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58387
--- Comment #11 from Jeffrey A. Law <law at redhat dot com> ---
I know what's happening here. It's obscure and quite nasty.
We have a jump threading opportunity which requires threading through a joiner
block. The jump thread leaving one edge of the joiner eventually reaches the
same block as the joiner's other outgoing edge.
This is all fine and good as the threading code knows the conditions under
which it's still safe to thread that jump. Specifically it has to look at the
PHI arguments for the two key edges and verify for each PHI that the values
associated with the two key edges are the same. This condition is in place to
make the SSA graph updates easier to deal with.
At the time we discover and register the jump thread the condition holds and
we're good to go. However a short time later we discover that we can propagate
a constant to one of those PHI arguments and do so. Now the condition we
needed for updating the SSA graph was broken. We update the SSA graph
incorrectly.
I'm going to have to review the SSA graph updating code a bit tomorrow AM. In
the mean time I'm going to revert the patch.