This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
i386: push <memory> ?
- To: egcs at cygnus dot com
- Subject: i386: push <memory> ?
- From: Martin Mares <mj at atrey dot karlin dot mff dot cuni dot cz>
- Date: Tue, 9 Sep 1997 21:12:46 +0200
Hello,
I've tried to compile (with -O2) the following code:
void main(int argc)
{
printf("%d\n", argc);
}
and was a bit surprised as I got:
main:
movl 4(%esp),%eax
pushl %eax
pushl $.LC0
call printf
addl $8,%esp
ret
Wouldn't it be better to use `pushl 4(%esp)' instead of loading it to %eax
and then pushing it (which probably causes pipeline stall as well)?
Have a nice fortnight
--
Martin `MJ' Mares <mj@gts.cz> http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"Quote of the day: '"