This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Revision 107218 changed addressing mode generation
On Thu, Mar 26, 2009 at 1:31 PM, Bernd Schmidt <bernds_cb1@t-online.de> wrote:
> Richard Guenther wrote:
>>
>> I think it would make sense to only apply the canonicalization if we
>> do not increase the number of multiplications. ?Thus,
>>
>> ?i * 2 + 4 ?-> (i + 2) * 2 ? ? ? is ok, but
>
> Actually, no. ?This is exactly the case I ran into. ?expand_expr with
> EXPAND_SUM does something sensible with the former but not the latter. When
> used as an address, the machine can use the constant offset in the former
> but not in the latter.
Ok, so IMHO the correct thing is to teach expand_expr to do sth
sensible with both forms (thus, let the target decide which one is
more profitable).
Richard.