public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/21788] New: [x86_64] Wrong Code When Taking Address of Argument
@ 2005-05-27 18:21 evandro at yahoo dot com
  2005-05-27 18:23 ` [Bug target/21788] " evandro at yahoo dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: evandro at yahoo dot com @ 2005-05-27 18:21 UTC (permalink / raw)
  To: gcc-bugs

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


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

end of thread, other threads:[~2005-06-05  9:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-27 18:21 [Bug target/21788] New: [x86_64] Wrong Code When Taking Address of Argument evandro at yahoo dot com
2005-05-27 18:23 ` [Bug target/21788] " evandro at yahoo dot com
2005-05-27 18:24 ` pinskia at gcc dot gnu dot org
2005-05-27 18:39 ` pinskia at gcc dot gnu dot org
2005-05-27 19:20 ` evandro at yahoo dot com
2005-06-05  9:22 ` pinskia at gcc dot gnu dot org
2005-06-05  9:23 ` pinskia at gcc dot gnu dot 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).