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: Alignment on x86


> Hi,
> 
> I'm in the process of adding a new call sequence to GCC 3.2 at the
> moment, implementing a more general sibcall optimisation on Intel
> platforms (and later others, too).  However, I'm wondering where I can
> find the right documentation on byte alignment for the stack.
> 
> What are the boundaries GCC tries to allocate for each stack frame?  I've
> always thought it was 16 byte alignment, and if a function has a few bytes
> for locals and args, then the rest are aligned as padding.  But now I've
> run into a few examples where I can't grasp the rationale anymore, behind
> the amount of bytes allocated on the stack.

GCC should keep 16byte alignment on the call boundary (so the esp just
before call instruction is 16byte aligned).  THis is to allow gcc to
make the frame 16byte aligned when it needs it, however GCC is not doing
that always, just when some objects in the frame needs it.
Se *frame_layout in i386.c

Honza
> 
> Any comments, links, hints to literature, etc. would be appreciated.
> 
> Thanks in advance,
> Andi.


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