This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Ways to fill the stack
- From: Ian Lance Taylor <iant at google dot com>
- To: sztfg at yandex dot ru
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 10 Feb 2013 09:44:46 -0800
- Subject: Re: Ways to fill the stack
- References: <354911360477847@web26d.yandex.ru> <357831360478564@web26d.yandex.ru>
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