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: unassig...@gcc.gnu.org
        ReportedBy: jhaber...@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

Reply via email to