This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug target/46942] x86_64 parameter passing unnecessary sign/zero extends


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

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> 2011-01-03 14:23:05 UTC ---
For

void f1(char c, char d, char e, char f, char g, char h, char i);

    char x;

    void f2()
    {
        f1(x, x, x, x, x, x, x);
    }

ICC generates this assembly, where we only store 8 bits to the stack
for the final parameter.

f2:
        pushq     %rsi
        addq      $-16, %rsp
        movsbl    x(%rip), %edi
        movb      %dil, (%rsp)
        movl      %edi, %esi
        movl      %edi, %edx
        movl      %edi, %ecx
        movl      %edi, %r8d
        movl      %edi, %r9d
        call      f1
        addq      $16, %rsp
        popq      %rcx
        ret


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