public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* question about -mpush-args -maccumulate-outgoing-args on gcc for x86
@ 2009-09-01 14:08 Godmar Back
  2009-09-01 15:08 ` Godmar Back
  2009-09-01 16:31 ` Ian Lance Taylor
  0 siblings, 2 replies; 4+ messages in thread
From: Godmar Back @ 2009-09-01 14:08 UTC (permalink / raw)
  To: gcc

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:

gback@setzer [39](~/tmp) > cat call.c
void caller(void) {
    extern void callee(int);
    callee(5);
}
gback@setzer [40](~/tmp) > gcc -mno-push-args -S call.c
gback@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-01 18:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-01 14:08 question about -mpush-args -maccumulate-outgoing-args on gcc for x86 Godmar Back
2009-09-01 15:08 ` Godmar Back
2009-09-01 16:31 ` Ian Lance Taylor
2009-09-01 18:40   ` Godmar Back

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).