This testcase:

int test (int a)
{
        return (double) a;
}

Produces:

        cvtsi2sd        %edi, %xmm0
        cvttsd2si       %xmm0, %eax
        ret

However, following code does the same (at least for -ffast-math):
        movl    %edi, %eax
        ret


-- 
           Summary: Optimize double INT->FP->INT conversions
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: uros at kss-loka dot si
GCC target triplet: x86_64-unknown-linux-gnu


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

Reply via email to