float convert( unsigned in )
{
        float f;
        __builtin_memcpy( &f, &in, sizeof( in ) );
        return f;
}

unsigned short load( void* p )
{
        unsigned short v;
        __builtin_memcpy( &v, p, sizeof( v ) );
        return v;
}

gcc-4.2.0-20070221

$ g++ temp.cpp -O2 -S

_Z7convertj:
        movl    %edi, -4(%rsp)
        movss   -4(%rsp), %xmm1
        movaps  %xmm1, %xmm0
        ret

_Z4loadPv:
        movzwl  (%rdi), %eax
        movw    %ax, -2(%rsp)
        movzwl  %ax, %eax
        ret


-- 
           Summary: redundant reg/mem stores/moves
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
GCC target triplet: x86_64-linux


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

Reply via email to