This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/46942] x86_64 parameter passing unnecessary sign/zero extends
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 3 Jan 2011 14:23:16 +0000
- Subject: [Bug target/46942] x86_64 parameter passing unnecessary sign/zero extends
- Auto-submitted: auto-generated
- References: <bug-46942-4@http.gcc.gnu.org/bugzilla/>
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