This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
GCC/assembly question
- From: Diego Figueroa <dfiguero at cs dot yorku dot ca>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 19 Jun 2003 10:16:34 -0400 (EDT)
- Subject: GCC/assembly question
Hi,
I was wondering why in Linux (RH9 - GCC 3.2.2-5 if I have this code:
main(){}
After 'gcc -S -o ex1.s ex1.c' I get:
...
main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
andl $-16, %esp
movl $0, %eax
subl %eax, %esp
leave
ret
...
What is the purpose of:
* subl $8, %esp
There are no variables so why is the stack making space?
* andl $-16, %esp
Is the 16-bit alignment something to do with processor performance?
* movl $0, %eax
subl %eax, %esp
Wasting time? I know if I pass the -O flag these two will dissapear from
the code.
Are there any documents where this sort of topics are discussed?
Thanks,
Diego.