This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question about -mpush-args -maccumulate-outgoing-args on gcc for x86
Minor correction to my previous email:
On Tue, Sep 1, 2009 at 10:08 AM, Godmar Back<godmar@gmail.com> wrote:
>
> gback@setzer [39](~/tmp) > cat call.c
> void caller(void) {
> ? ?extern void callee(int);
> ? ?callee(5);
> }
This:
> gback@setzer [40](~/tmp) > gcc -mno-push-args -S call.c
should be '-mpush-args' as in:
gback@cyan [4](~/tmp) > gcc -S -mpush-args call.c
gback@cyan [5](~/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
The point here is that '-mpush-args' is ineffective unless
'-mno-accumulate-outgoing-args' is given, and that the documentation,
in my opinion, may be misleading by
a) not mentioning the -mno-accumulate-outgoing-args switch
b) saying that '-mpush-args' is the default when it's an ineffective
default (since the default -maccumulate-outgoing-args appears to
override it)
c) not mentioning that -maccumulate-outgoing-args is the default - in
fact, the discussion in the section of push-args/no-push-args appears
to imply that it shouldn't be the default.
Thanks.
- Godmar