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]

question about allocating local variable


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


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