http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48607
Summary: Inefficient complex float parameter passing Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassig...@gcc.gnu.org ReportedBy: hjl.to...@gmail.com CC: ubiz...@gmail.com [hjl@gnu-6 pr1000]$ cat z.i typedef _Complex float SCtype; SCtype foo (SCtype x1, SCtype x2, SCtype x3, SCtype x4, SCtype x5, SCtype x6, SCtype x7, SCtype x8, SCtype a, SCtype b) { return x2; } [hjl@gnu-6 pr1000]$ /usr/gcc-4.7/bin/gcc -O2 -S z.i [hjl@gnu-6 pr1000]$ cat z.s .file "z.i" .text .p2align 4,,15 .globl foo .type foo, @function foo: .LFB0: .cfi_startproc movq %xmm1, -16(%rsp) movl -16(%rsp), %eax movl %eax, -72(%rsp) movl -12(%rsp), %eax movl %eax, -68(%rsp) movq -72(%rsp), %xmm0 ret .cfi_endproc .LFE0: .size foo, .-foo .ident "GCC: (GNU) 4.7.0 20110406 (experimental) [trunk revision 172062]" .section .note.GNU-stack,"",@progbits [hjl@gnu-6 pr1000]$ We should simply do movaps %xmm1, %xmm0 or movq %xmm1,%xmm0