Patchwork Combine-4 fallout fix

login
register
mail settings
Submitter Bernd Schmidt
Date Aug. 24, 2010, 11:57 p.m.
Message ID <4C745C56.7000902@codesourcery.com>
Download mbox | patch
Permalink /patch/62643/
State New
Headers show

Comments

Bernd Schmidt - Aug. 24, 2010, 11:57 p.m.
HJ has verified that this patch fixes a testsuite failure on ia64.  The
problem occurs when computing the graph of which insn feeds which - we
use dead_or_set_p to determine whether i1 clobbers the register set by
i0, but that fails if i1 sets a ZERO_EXTRACT.  Using
reg_overlap_mentioned_p instead should solve it.

Bootstrapped and regression tested on i686-linux, ok?


Bernd
PR middle-end/45355
	* combine.c (try_combine): Use reg_overlap_mentioned_p rather than
	dead_or_set_p when computing i0_feeds_i2_n.
Mark Mitchell - Aug. 25, 2010, 1:36 a.m.
Bernd Schmidt wrote:
> HJ has verified that this patch fixes a testsuite failure on ia64.  The
> problem occurs when computing the graph of which insn feeds which - we
> use dead_or_set_p to determine whether i1 clobbers the register set by
> i0, but that fails if i1 sets a ZERO_EXTRACT.  Using
> reg_overlap_mentioned_p instead should solve it.
> 
> Bootstrapped and regression tested on i686-linux, ok?

OK.

Patch

Index: combine.c
===================================================================
--- combine.c	(revision 163389)
+++ combine.c	(working copy)
@@ -2862,7 +2862,7 @@  try_combine (rtx i3, rtx i2, rtx i1, rtx
   i1_feeds_i2_n = i1 && insn_a_feeds_b (i1, i2);
   i0_feeds_i1_n = i0 && insn_a_feeds_b (i0, i1);
   i0_feeds_i2_n = (i0 && (!i0_feeds_i1_n ? insn_a_feeds_b (i0, i2)
-			  : (!dead_or_set_p (i1, i0dest)
+			  : (!reg_overlap_mentioned_p (i1dest, i0dest)
 			     && reg_overlap_mentioned_p (i0dest, i2src))));
 
   /* Ensure that I3's pattern can be the destination of combines.  */