This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix canonicalization of addresses
> 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. 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. */
--
Eric Botcazou