This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ways to fill the stack


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]