[PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p

H.J. Lu hjl@lucon.org
Sat Jul 14 16:57:00 GMT 2007


On Sat, Jul 14, 2007 at 09:48:44AM -0700, H.J. Lu wrote:
> On Sat, Jul 14, 2007 at 10:38:34AM -0500, Peter Bergner wrote:
> > On Sat, 2007-07-14 at 07:25 -0700, H.J. Lu wrote:
> > > Peter, will gcc-PR28690-5.patch solve your problem?
> > 
> > I'm not sure you actually looked at my previous post or the patch.
> > By leaving out the changes that adjust all of the precedence values
> > by -3 but leaving in this part:
> > 
> > -      return -1;
> > +      if (REG_P (op))
> > +       return (REG_POINTER (op)) ? -1 : -3;
> > +      else
> > +       return (MEM_P (op) && MEM_POINTER (op)) ? -2 : -4;
> > 
> > You have now just changed the precedence sorting in an unwanted way.
> > For example, RTX_EXTRA which has a precedence of -2 (-5 with my patch)
> > and previously always had a lower precedence than all RTX_OBJs, now has
> > the same precedence or higher precedence than REG's and MEM's.
> > We don't want that!
> > 
> > As I mentioned in the previous post, the adjustment of the precedence
> > values by -3 is totally cosmetic and will not change the behavior of
> > the compiler in any way, so I'm curious why you even attempted to leave
> > that part out.
> > 
> > Peter
> > 
> 
> Something like this? I have a question on this part
> 
> 
> +      if (REG_P (op))
> +	return (REG_POINTER (op)) ? -1 : -3;
> +      else
> +	return (MEM_P (op) && MEM_POINTER (op)) ? -2 : -4;
> 
> 
> So the order Power 6 prefers is
> 
> 1. REG_POINTER
> 2. MEM_POINTER
> 3. REG_P
> 4. MEM_P
> 
> Is that correct? Will
> 
> 1. REG_POINTER
> 2. MEM_POINTER
> 3. REG_P/MEM_P
> 
> work for you.
> 

Also will

1. REG_POINTER/MEM_POINTER
2. REG_P/MEM_P

work for you.


H.J.



More information about the Gcc-patches mailing list