This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix canonicalization of addresses
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org, Andrew Haley <aph at redhat dot com>
- Date: Tue, 06 Jan 2009 15:13:05 +0000
- Subject: Re: [PATCH] Fix canonicalization of addresses
- References: <200812231211.50787.ebotcazou@adacore.com> <200812292202.57337.ebotcazou@adacore.com> <84fc9c000812291351w53a489bah875c219f1486f74e@mail.gmail.com> <200901061517.32961.ebotcazou@adacore.com>
On Tue, 2009-01-06 at 15:17 +0100, Eric Botcazou wrote:
> > In the above case transforming -A * -CST to A * CST (which would handle
> > the (1 - ind) * -2 case also if witten that way by a user, not only if
> > generated by fold_plusminus_mult). Thus, it subsumes the plusminus_mult
> > patch in favor of a IMHO better one.
>
> I disagree. The factorization by a negative power of 2 in plusminus_mult
> doesn't serve any useful purpose and can be harmful, as shown here; instead
> of relying on a later transformation to repair the damages, let's not create
> them in the first place, this will save both time and memory.
Seconded. Furthermore, subtraction of a variable from a constant is
less widely supported in CPUs than addition of small negative numbers --
ie subtracting a constant (The Thumb instruction set has sub reg, const,
but not sub const, reg).
R.