public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Alignment on x86
@ 2002-09-01 20:37 Andreas Bauer
  2002-09-02  2:57 ` Jan Hubicka
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Bauer @ 2002-09-01 20:37 UTC (permalink / raw)
  To: gcc

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.

Any comments, links, hints to literature, etc. would be appreciated.

Thanks in advance,
Andi.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Alignment on x86
  2002-09-01 20:37 Alignment on x86 Andreas Bauer
@ 2002-09-02  2:57 ` Jan Hubicka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Hubicka @ 2002-09-02  2:57 UTC (permalink / raw)
  To: Andreas Bauer; +Cc: gcc

> 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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-02  9:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-01 20:37 Alignment on x86 Andreas Bauer
2002-09-02  2:57 ` Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).