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]

Re: Gcc extra alignment..


In article <200010311747.JAA07046@penguin.transmeta.com> you write:

> I've gotten some reports about unnecessary alignment for the standard
> macro construct "do { ...  } while (0)", and while I can't verify this
> myself with my old gcc-2.91.66 installation I thought I'd mention the
> complaint here in case somebody with the current snapshots can verify
> whether it is fixed.. 

Anyone can test the current (nightly, not the weekly tagged one)
snapshot on x86 GNU/Linux.  Use the page at:

http://www.codesourcery.com/gcc-compile.shtml

"The current build of GCC is: gcc version 2.97 20001031 (experimental)"

I selected source language: 'preprocessed C', output: 'assembly',
program source:

bar ();

foo ()
{
  do { bar (); } while (0);
}

Here was the result after clicking 'Compile with GCC':

foo:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        nop
        call    bar
        leave
        ret

After removing the dummy loop, we see:

foo:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        call    bar
        leave
        ret

Looks like the padding is still there.
-- 
Loren J. Rittle
Staff Software Engineer, Distributed Object Technology Lab
Networks and Infrastructure Research Lab (IL02/2240), Motorola Labs
rittle@rsch.comm.mot.com, KeyID: 2048/ADCE34A5, FDC0292446937F2A240BC07D42763672

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