This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/38183] New: Useless move to memory when passing small structs to functions
- From: "jch at pps dot jussieu dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Nov 2008 20:39:40 -0000
- Subject: [Bug c/38183] New: Useless move to memory when passing small structs to functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider the following:
struct s { double x; double y; };
double f(struct s s) { return s.x + s.y; }
When compiled with optimisation, this generates:
f:
movsd %xmm1, -8(%rsp)
addsd %xmm1, %xmm0
ret
What is the movsd doing here ?
--
Summary: Useless move to memory when passing small structs to
functions
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jch at pps dot jussieu dot fr
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38183