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, 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.


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