P
Prawit Chaivong
Hi All
I don't know whether I should post this thing to compiler group or
this group.
Anyway, I decided to post to this group. (I'm sorry if you think I
post in wrong group)
My question is...
I wrote the program like this.
void func()
{
char a[8];
}
And then compile to asm code (gcc with -S option)
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.
I don't know whether I should post this thing to compiler group or
this group.
Anyway, I decided to post to this group. (I'm sorry if you think I
post in wrong group)
My question is...
I wrote the program like this.
void func()
{
char a[8];
}
And then compile to asm code (gcc with -S option)
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.