This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Question on unexpected asm output
- To: Tim Oertel <toertel at rpa dot net>
- Subject: Re: Question on unexpected asm output
- From: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- Date: Mon, 5 Mar 2001 17:30:54 +1100
- Cc: gcc at gcc dot gnu dot org
- References: <3AA31BBD.AD6FC302@rpa.net>
On 04-Mar-2001, Tim Oertel <toertel@rpa.net> wrote:
>
> 0: 83 ec 0c sub $0xc,%esp
> 3: e8 fc ff ff ff call 4 <foobar0+0x4>
> 8: 83 c4 0c add $0xc,%esp
> b: c3 ret
>
> My question is why is there the extra sub and add? I'd
> expect them if I had any locals, but I don't, and the
> extra stack allocated isn't even used.
The purpose of that is to keep the stack aligned to a 16-byte boundary.
For details, see the documentation of the `-mpreferred-stack-boundary='
option in the GCC manual. You can use that option to override this behaviour.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.