This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] tree-ssa-dom.c: Fix tree-optimization/18694.


On Thu, 2004-12-09 at 20:43 -0500, Kazu Hirata wrote:
> Hi,
> 
> Attached is a patch to fix PR 18694.
[ ... ]
Attached is the patch I actually checked in to fix PR18694.

As I mentioned Friday, there's a nice simple solution to this problem 
which doesn't hinder jump threading significantly.

Specifically we simply refuse to thread jumps if we have a PHI argument
which is set from a PHI_RESULT in the same block and the PHI argument is
not identical to the PHI result.

This is different from Kazu's patch in two significant ways.

First, Kazu's patch avoided creating equivalences and recording new
definitions.  It still tried to thread through the block with the
problematical PHI dependencies.  My patch disables threading through
such blocks.

Second, my match contains a better test to detect the problematical
PHIs and thus avoid over-pessimizing in cases where we have PHIs for
loop invariants.  ie  x_2 = phi (0, x_1, x_2);   Kazu's original
patch would flag the 3rd alternative as problematical when in fact
it causes no problems at all.

I'll also check in Kazu's reduced testcase momentarily.

Bootstrapped and regression tested on i686-pc-linux-gnu.


Attachment: PPP
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]