This is the mail archive of the gcc@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]

i386: push <memory> ?


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


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