[LLVMbugs] [Bug 1649] New: Invalid alignment for SSE2 code

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Sep 11 00:09:58 PDT 2007


http://llvm.org/bugs/show_bug.cgi?id=1649

           Summary: Invalid alignment for SSE2 code
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: asl at math.spbu.ru
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=1113)
 --> (http://llvm.org/bugs/attachment.cgi?id=1113)
Function extracted

Consider attached testcase.

In bb79:

bb79:           ; preds = %bb57
        %tmp81 = load double* %tmp68, align 16          ; <double> [#uses=1]
        %tmp82 = sub double -0.000000e+00, %tmp81               ; <double>
[#uses=1]
        store double %tmp82, double* %tmp68, align 16
        %tmp84 = getelementptr [3 x double]* %Raw_Normal, i32 0, i32 1         
; <double*> [#uses=2]
        %tmp85 = load double* %tmp84, align 8           ; <double> [#uses=1]
        %tmp86 = sub double -0.000000e+00, %tmp85               ; <double>
[#uses=1]
        store double %tmp86, double* %tmp84, align 8
        %tmp88 = getelementptr [3 x double]* %Raw_Normal, i32 0, i32 2         
; <double*> [#uses=2]
        %tmp89 = load double* %tmp88, align 8           ; <double> [#uses=1]
        %tmp90 = sub double -0.000000e+00, %tmp89               ; <double>
[#uses=1]
        store double %tmp90, double* %tmp88, align 8
        br label %bb92

This is codegen'ed (-disable-fp-elim) into:

        movsd   .LCPI1_0, %xmm0
        movapd  %xmm0, %xmm1
        xorpd   -104(%ebp), %xmm1
        movsd   %xmm1, -104(%ebp)
        movsd   -96(%ebp), %xmm1
        xorpd   %xmm0, %xmm1
        movsd   %xmm1, -96(%ebp)
        movsd   -88(%ebp), %xmm1
        xorpd   %xmm0, %xmm1
        movsd   %xmm1, -88(%ebp)

We definitely see a problem: even if %ebp is 16-bytes aligned, the access of
temporaries is not aligned at all.

This causes povray miscompilation at -O2.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list