Am 21.03.2007, 23:38 Uhr, schrieb Ian Lance Taylor <[EMAIL PROTECTED]>:

"H. J. Lu" <[EMAIL PROTECTED]> writes:

On Wed, Mar 21, 2007 at 09:19:44PM +0100, fafa wrote:
> Hi all,
>
> I noticed that G++ 4.1.2 (on a Pentium 4) generates different instructions
> for
>   lea    0x0(%esi),%esi
> or
>   lea    0x0(%edi),%edi
> with the same meaning but different encoding depending on the switch
> "-momit-leaf-frame-pointer".
>

They are generated by assembler for different alignment adjustments.

To expand on that, note that those instructions do nothing.  They are
nops inserted for alignment purposes.  The size of the instruction
varies depending upon how many bytes it has to take up.

Ian


I see. But why not simple "nop" instructions ?
Is it just for the compactness of the listing, or does it
optimize the instruction prefetching of the CPU ?

Maett

Reply via email to