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] Fix canonicalization of addresses


On Tue, Jan 6, 2009 at 11:19 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> To repeat: it's a canonicalization.  And it helps for canonicalizing a
>> * (-2) - 8 to (a + 4)*(-2)
>> and allowing CSE with another a + 4.  I don't think that in this case
>> we want to have (-4 - a)*2.
>
> The - - should be canonicalized elsewhere.

How?  By extracting the common multiplication by -1? ...

> Changing the sign without further
> analysis is just plain wrong and appears to be an unexpected fallout of the
> change, according to the comment:
>
>  /* No identical multiplicands; see if we can find a common
>     power-of-two factor in non-power-of-two multiplies.  This
>     can help in multi-dimensional array access.  */

Well, the change was to merge different similar transformations if I remember
correctly.  Also the change just introduced a more complete canonicalization.
So the comment is out-of-date.

And yes, we miss a (1 - i) * -2 to (i - 1) * 2 canonicalization, but I
think I said that, no?
Why do you keep arguing?  (or rather, why do I?)

Richard.


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