https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77851

            Bug ID: 77851
           Summary: Odd code for _Complex float return value
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ubizjak at gmail dot com
  Target Milestone: ---
            Target: x86-64

[hjl@gnu-6 gcc]$ cat /tmp/c.c 
_Complex float
foo (_Complex float y)
{
  return y;
}
[hjl@gnu-6 gcc]$ ./xgcc -B./ -S /tmp/c.c -O3
[hjl@gnu-6 gcc]$ cat c.s 
        .file   "c.c"
        .text
        .p2align 4,,15
        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        movq    %xmm0, -8(%rsp)
        movss   -8(%rsp), %xmm0
        movss   %xmm0, -16(%rsp)
        movss   -4(%rsp), %xmm0
        movss   %xmm0, -12(%rsp)
        movq    -16(%rsp), %xmm0
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .ident  "GCC: (GNU) 7.0.0 20161004 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-6 gcc]$ 

It should be simply "ret".

Reply via email to