http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59443

            Bug ID: 59443
           Summary: Passing arguments via stack in x86-64
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dennis at yurichev dot com

Excuse me, but it is correct code generated for x86-64?

#include <stdio.h>

void f1(long long int a, long long int b, long long int c, long long int d,
long long int e, long long int f, long long int g)
{
        printf ("%lld %lld %lld %lld %lld %lld %lld\n", a, b, c, d, e, f, g);
};

int main()
{
        f1(1L,2L,3L,4L,5L,6L,7L);
};

gcc -S -masm=intel 1.c

I've got:

main:
.LFB1:
        push    rbp
        mov     rbp, rsp
        sub     rsp, 16
        mov     QWORD PTR [rsp], 7
        mov     r9d, 6
        mov     r8d, 5
        mov     ecx, 4
        mov     edx, 3
        mov     esi, 2
        mov     edi, 1
        call    f1
        leave
        ret

Is it correct to fill only 32-bit parts of x64 registers? The values passed are
long long.

Reply via email to