Ways to fill the stack

Ian Lance Taylor iant@google.com
Sun Feb 10 17:44:00 GMT 2013


On Sat, Feb 9, 2013 at 10:42 PM,  <sztfg@yandex.ru> wrote:
> 10.02.2013, 10:13, "Ian Lance Taylor" <iant@google.com>:
>
>>  I don't see why this would ever use a push instruction.  Arguments are
>>  passed in registers on x86_64.  For each call the local array is built
>>  on the stack, then the address of the array is passed in a register.
>
> Local array can be build on the stack, using push instruction.

Sure, but why would that be a good idea?

In any case GCC does not generally use push instructions for local
variables.  Instead GCC allocates a frame on the stack, and fills in
values as needed.  GCC does in some cases use push instructions to
push arguments to functions.  Is there any reason that GCC should use
push instructions for local variables?

Ian



More information about the Gcc-help mailing list