Hi,

I'm using gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) for a x86
target. The info page says:

`-mpush-args'
`-mno-push-args'
     Use PUSH operations to store outgoing parameters.  This method is
     shorter and usually equally fast as method using SUB/MOV
     operations and is enabled by default.  In some cases disabling it
     may improve performance because of improved scheduling and reduced
     dependencies.

`-maccumulate-outgoing-args'
     If enabled, the maximum amount of space required for outgoing
     arguments will be computed in the function prologue.  This is
     faster on most modern CPUs because of reduced dependencies,
     improved scheduling and reduced stack usage when preferred stack
     boundary is not equal to 2.  The drawback is a notable increase in
     code size.  This switch implies `-mno-push-args'.

This information is also found on
http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
----------------

Is this information up-to-date?

It appears to me that '-mno-push-args' is the enabled by default (*),
and not '-mpush-args'.  Moreover, since -maccumulate-outgoing-args
implies -mno-push-args, it appears that the only way to obtain
'push-args' behavior is to specify '-mno-accumulate-outgoing-args' - a
switch which the documentation doesn't even mention.

I have searched the mailing list archives and the only post I found
was this one:
http://gcc.gnu.org/ml/gcc/2005-01/msg00761.html which is at odds with
the documentation above.

Thanks.

 - Godmar

(*) for instance, see:

gb...@setzer [39](~/tmp) > cat call.c
void caller(void) {
    extern void callee(int);
    callee(5);
}
gb...@setzer [40](~/tmp) > gcc -mno-push-args -S call.c
gb...@setzer [41](~/tmp) > cat call.s
        .file   "call.c"
        .text
.globl caller
        .type   caller, @function
caller:
        pushl   %ebp
        movl    %esp, %ebp
        subl    $8, %esp
        movl    $5, (%esp)
        call    callee
        leave
        ret
        .size   caller, .-caller
        .ident  "GCC: (GNU) 4.1.2 20080704 (Red Hat 4.1.2-44)"
        .section        .note.GNU-stack,"",@progbits

Reply via email to