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



             Bug #: 55941

           Summary: [4.8 Regression] Strange copy of double (in struct) to

                    stack

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: target

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: gli...@gcc.gnu.org

            Target: x86_64-linux-gnu





typedef struct A { double a, b; } A;

double f(A x,double y){return x.a+y;}



generates with gcc -Ofast -S:



    addsd    %xmm0, %xmm2

    movsd    %xmm0, -8(%rsp)

    movapd    %xmm2, %xmm0

    ret



I don't understand what that movsd is doing there?



Note that gcc-4.7 generates the expected:



    addsd    %xmm2, %xmm0

    ret

Reply via email to