This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: ill effect of <register>+<constant>
>>> Andreas Schwab <schwab@suse.de> 21.09.07 16:06 >>>
>"Jan Beulich" <jbeulich@novell.com> writes:
>
>> Isn't it a bug that, for i386,
>>
>> .text
>> .intel_syntax noprefix
>> _start:
>> .equ base, edx+4
>> .equ idx, edi-1
>> mov eax, [base+idx*4]
>>
>> results in
>>
>> mov eax, [esi+esi*4]
>>
>> ? Consequently, shouldn't expr() refrain from doing *any* optimization when
>> either side of O_add or the left side of O_subtract is a register?
>
>No, that would disable a useful feature.
To me, adding a constant to a register and getting a different register is
all but a useful feature (maybe it is in e.g. PPC semantics where registers
can be represented by plain numbers). But beyond that, I can't see what
useful feature you're thinking about - could you be a little more verbose?
Thanks, Jan