This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/48609] New: Inefficient complex float store
- 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: Thu, 14 Apr 2011 13:57:35 +0000
- Subject: [Bug target/48609] New: Inefficient complex float store
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48609
Summary: Inefficient complex float store
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hjl.tools@gmail.com
CC: ubizjak@gmail.com
Target: x86_64
[hjl@gnu-6 pr1000]$ cat s2.i
typedef _Complex float SCtype;
extern SCtype bar;
void
foo (SCtype x)
{
bar = x;
}
[hjl@gnu-6 pr1000]$ /usr/gcc-4.7/bin/gcc -S -O2 s2.i
[hjl@gnu-6 pr1000]$ cat s2.s
.file "s2.i"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
.LFB0:
.cfi_startproc
movq %xmm0, -8(%rsp)
movl -8(%rsp), %eax
movl %eax, bar(%rip)
movl -4(%rsp), %eax
movl %eax, bar+4(%rip)
ret
.cfi_endproc
.LFE0:
.size foo, .-foo
We should simply do
movq %xmm0, bar(%rip)