public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/59464] New: Unnecessary vector register spill
@ 2013-12-11  0:54 hjl.tools at gmail dot com
  2013-12-11  9:21 ` [Bug target/59464] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: hjl.tools at gmail dot com @ 2013-12-11  0:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59464
           Summary: Unnecessary vector register spill
           Product: gcc
           Version: 4.9.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: x86-64

[[hjl@gnu-6 gcc]$ cat /tmp/v.c
typedef struct
{
  float f1;
  float f2;
  float f3;
  float f4;
} test_structure_8;
test_structure_8 struct8 (test_structure_8 ts)
{
  ts.f1 += 1;
  ts.f2 += 1;
  ts.f3 += 1;
  ts.f4 += 1;
  return ts;
}
[hjl@gnu-6 gcc]$ ./xgcc -B./ -O3 -S /tmp/v.c
[hjl@gnu-6 gcc]$ cat v.s
    .file    "v.c"
    .section    .text.unlikely,"ax",@progbits
.LCOLDB1:
    .text
.LHOTB1:
    .p2align 4,,15
    .globl    struct8
    .type    struct8, @function
struct8:
.LFB0:
    .cfi_startproc
    movq    %xmm1, -32(%rsp)
    movq    %xmm0, -40(%rsp)
    movups    -40(%rsp), %xmm0
    addps    .LC0(%rip), %xmm0
    movaps    %xmm0, -56(%rsp)
    movq    -48(%rsp), %rax
    movq    -56(%rsp), %xmm0
    movq    %rax, -56(%rsp)
    movq    -56(%rsp), %xmm1
    ret
    .cfi_endproc
.LFE0:
    .size    struct8, .-struct8
    .section    .text.unlikely
.LCOLDE1:
    .text
.LHOTE1:
    .section    .rodata.cst16,"aM",@progbits,16
    .align 16
.LC0:
    .long    1065353216
    .long    1065353216
    .long    1065353216
    .long    1065353216
    .ident    "GCC: (GNU) 4.9.0 20131210 (experimental)"
    .section    .note.GNU-stack,"",@progbits
[hjl@gnu-6 gcc]$ 

At least, we should do

    .globl    struct8
    .type    struct8, @function
struct8:
.LFB0:
    .cfi_startproc
    movq    %xmm1, -32(%rsp)
    movq    %xmm0, -40(%rsp)
    movups    -40(%rsp), %xmm0
    addps    .LC0(%rip), %xmm0
    movaps    %xmm0, -56(%rsp)
    movq    -48(%rsp), %xmm1
    movq    -56(%rsp), %xmm0
    ret
    .cfi_endproc
.LFE0:
    .size    struct8, .-struct8


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-12-11  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-11  0:54 [Bug target/59464] New: Unnecessary vector register spill hjl.tools at gmail dot com
2013-12-11  9:21 ` [Bug target/59464] " rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).