This is the mail archive of the gcc@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: GCC 4.1.2 generates different pentium instructions


Am 21.03.2007, 23:38 Uhr, schrieb Ian Lance Taylor <iant@google.com>:

"H. J. Lu" <hjl@lucon.org> 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


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