public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* question about allocating local variable
@ 2004-06-28 15:27 Prawit Chaivong
  2004-06-28 15:50 ` Eljay Love-Jensen
  0 siblings, 1 reply; 7+ messages in thread
From: Prawit Chaivong @ 2004-06-28 15:27 UTC (permalink / raw)
  To: gcc-help

My question is... 
I wrote the program like this.
 
void func()
{
  char a[8];
}

And then compile to asm code I've got this line of
code.

.....
subl $8 %esp
.....

That makes sense, It moves stack pointer down 8 bytes
for local variable.
But the problem is, when I change size of array to 9
or 7 the asm code turn to this.

....
subl $24 %esp
....

It doesn't make any sense to me. Why it allocates 24
bytes for 9 or 7 bytes variable.

Does anybody has any explaination?

Thank in advance.
Prawit C.


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-29 13:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-28 15:27 question about allocating local variable 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
2004-06-29  3:14   ` Prawit Chaivong
2004-06-29 13:39     ` Eljay Love-Jensen

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).