This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/21788] New: [x86_64] Wrong Code When Taking Address of Argument
- From: "evandro at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 May 2005 18:19:03 -0000
- Subject: [Bug target/21788] New: [x86_64] Wrong Code When Taking Address of Argument
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Using -O2 or greater, when taking the address of an input argument results in
the wrong code. For example:
int foo (double d)
{
int *p = (int *) &d;
return (*p);
}
With -O2 results in:
foo:
movq -8(%rsp), %eax
ret
With -O1 results in:
foo:
movsd %xmm0, -8(%rsp)
movq -8(%rsp), %eax
ret
--
Summary: [x86_64] Wrong Code When Taking Address of Argument
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: evandro at yahoo dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21788