i386: push <memory> ?

Martin Mares mj@atrey.karlin.mff.cuni.cz
Tue Sep 9 12:13:00 GMT 1997


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: '"



More information about the Gcc mailing list