public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: llewelly@xmission.com
To: Purnendu/Gmail <purnendu@gmail.com>
Cc: Eljay Love-Jensen <eljay@adobe.com>,
	Prawit Chaivong <arsenal_pui@yahoo.com>,
	 gcc-help@gcc.gnu.org
Subject: Re: question about allocating local variable
Date: Mon, 28 Jun 2004 17:36:00 -0000	[thread overview]
Message-ID: <s3rk6xrwpn3.fsf@solaris.xmission.com> (raw)
In-Reply-To: <4ca029ac04062809323fb4624f@mail.gmail.com>

Purnendu/Gmail <purnendu@gmail.com> writes:

> On a solaris platform with gcc 3.0 the one i have
> out put for such a behaviour is pretty predictive.
> 
> It allocates a stack of 120 for char a[1] to char a[8]
> then 128 for char a[9] to char a[16]
> and so on.
> 
> for an integer array
> It allocates a stack of 120 for int a[1] and int a[2]
> then 128 for int a[3] to int a[4]
> and so on.
> 
> with a allignment of 4 bytes
> 
> ===============
> 
>  .file   "help.c"
>         .section        ".text"
>         .align 4
>         .global main
>         .type   main,#function
>         .proc   04
> main:
>         !#PROLOGUE# 0
>         save    %sp, -128, %sp

This isn't just for your array. Most of it is for saving the register
    stack. 

>         !#PROLOGUE# 1
>         ret
>         restore
> .LLfe1:
>         .size   main,.LLfe1-main
>         .ident  "GCC: (GNU) 3.0"
> ~
[snip]

  parent reply	other threads:[~2004-06-28 17:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-28 15:27 Prawit Chaivong
2004-06-28 15:50 ` Eljay Love-Jensen
2004-06-28 16:32   ` Purnendu/Gmail
2004-06-28 16:52     ` Eljay Love-Jensen
2004-06-28 17:36     ` llewelly [this message]
2004-06-29  3:14   ` Prawit Chaivong
2004-06-29 13:39     ` Eljay Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s3rk6xrwpn3.fsf@solaris.xmission.com \
    --to=llewelly@xmission.com \
    --cc=arsenal_pui@yahoo.com \
    --cc=eljay@adobe.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=purnendu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).