public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/52055] New: load of 64-bit pointer reads 64 bits even when only 32 are used
@ 2012-01-30 19:28 jhaberman at gmail dot com
  2012-01-31 11:44 ` [Bug target/52055] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jhaberman at gmail dot com @ 2012-01-30 19:28 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52055
           Summary: load of 64-bit pointer reads 64 bits even when only 32
                    are used
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jhaberman@gmail.com


The following test program:

#include <stdint.h>
uint32_t rd32(uint64_t *i) { return *i; }

Compiles to this (-O3 -fomit-frame-pointer):

0000000000000000 <rd32>:
   0:    48 8b 07                 mov    rax,QWORD PTR [rdi]
   3:    c3                       ret    

But Clang compiles to this, which seems correct, is one byte shorter and
touches less memory:

0000000000000000 <rd32>:
   0:    8b 07                    mov    eax,DWORD PTR [rdi]
   2:    c3                       ret


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

end of thread, other threads:[~2012-02-14  5:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-30 19:28 [Bug target/52055] New: load of 64-bit pointer reads 64 bits even when only 32 are used jhaberman at gmail dot com
2012-01-31 11:44 ` [Bug target/52055] " rguenth at gcc dot gnu.org
2012-01-31 18:29 ` jhaberman at gmail dot com
2012-01-31 19:02 ` jakub at gcc dot gnu.org
2012-02-01 16:14 ` ebotcazou at gcc dot gnu.org
2012-02-01 16:36 ` jakub at gcc dot gnu.org
2012-02-14  5:22 ` pinskia 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).