GCC substracting strange amount of bytes from esp

Ian Lance Taylor iant@google.com
Sat Jan 29 11:27:00 GMT 2011


Bastian Ballmann <balle@chaostal.de> writes:

> If I disassemble the test function I see that gcc 4.5.2 produced the
> following assembly:
>
>    0x08048374 <+0>:     push   %ebp
>    0x08048375 <+1>:     mov    %esp,%ebp
>    0x08048377 <+3>:     sub    $0x20,%esp
>    0x0804837a <+6>:     leave
>    0x0804837b <+7>:     ret
>
> I would expect that 0x1c or 0x18 byte will be substracted from esp, but
> it's 0x20. 

See the -mpreferred-stack-boundary option.

Ian



More information about the Gcc-help mailing list