Patchwork combiner fix, PR45966

login
register
mail settings
Submitter Bernd Schmidt
Date Oct. 11, 2010, 7:45 p.m.
Message ID <4CB36977.7000401@codesourcery.com>
Download mbox | patch
Permalink /patch/67476/
State New
Headers show

Comments

Bernd Schmidt - Oct. 11, 2010, 7:45 p.m.
The combine-4 patch caused PR45966.  We have a 4->2 combination, and i0
feeds i1 which feeds i2.  When substituting, we only check i0_feeds_i2
and i1_feeds_i2; we also need to check the i0_feeds_i1/i1_feeds_i2 chain
and substitute accordingly.

Bootstrapped and regression tested on i686-linux; ok?


Bernd
* combine.c (try_combine): If added_sets_2, deal with the case
	where i0 feeds i1 and i1 feeds i2.
Richard Guenther - Oct. 12, 2010, 10:05 a.m.
On Mon, Oct 11, 2010 at 9:45 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> The combine-4 patch caused PR45966.  We have a 4->2 combination, and i0
> feeds i1 which feeds i2.  When substituting, we only check i0_feeds_i2
> and i1_feeds_i2; we also need to check the i0_feeds_i1/i1_feeds_i2 chain
> and substitute accordingly.
>
> Bootstrapped and regression tested on i686-linux; ok?

Ok.

Thanks,
Richard.

>
> Bernd
>
H.J. Lu - Oct. 31, 2010, 3:17 p.m.
On Mon, Oct 11, 2010 at 12:45 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> The combine-4 patch caused PR45966.  We have a 4->2 combination, and i0
> feeds i1 which feeds i2.  When substituting, we only check i0_feeds_i2
> and i1_feeds_i2; we also need to check the i0_feeds_i1/i1_feeds_i2 chain
> and substitute accordingly.
>
> Bootstrapped and regression tested on i686-linux; ok?
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46248
H.J. Lu - Oct. 31, 2010, 3:50 p.m.
On Sun, Oct 31, 2010 at 8:17 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Oct 11, 2010 at 12:45 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
>> The combine-4 patch caused PR45966.  We have a 4->2 combination, and i0
>> feeds i1 which feeds i2.  When substituting, we only check i0_feeds_i2
>> and i1_feeds_i2; we also need to check the i0_feeds_i1/i1_feeds_i2 chain
>> and substitute accordingly.
>>
>> Bootstrapped and regression tested on i686-linux; ok?
>>
>
> This caused:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46248
>

It also caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46212

Patch

Index: combine.c
===================================================================
--- combine.c	(revision 164961)
+++ combine.c	(working copy)
@@ -3213,6 +3213,8 @@  try_combine (rtx i3, rtx i2, rtx i1, rtx
 	    t = subst (t, i0dest, i0src, 0, 0);
 	  if (i1_feeds_i2_n)
 	    t = subst (t, i1dest, i1src, 0, 0);
+	  if (i0_feeds_i1_n && i1_feeds_i2_n)
+	    t = subst (t, i0dest, i0src, 0, 0);
 
 	  XVECEXP (newpat, 0, --total_sets) = t;
 	}