[LLVMbugs] [Bug 22572] New: misaligned callee save of xmm registers on windows when avx enabled

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 12 15:29:25 PST 2015


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

            Bug ID: 22572
           Summary: misaligned callee save of xmm registers on windows
                    when avx enabled
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: andrew.b.adams at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13858
  --> http://llvm.org/bugs/attachment.cgi?id=13858&action=edit
Broken ll

Compiling the attached ll like so:

llc mandelbrot.ll -filetype=asm -o -

I get the following prologue for the function "par for mandelbrot_f0.s0.y.yo".
It's correct.

        pushq   %rbp
        pushq   %r15
        pushq   %r14
        pushq   %r13
        pushq   %r12
        pushq   %rsi
        pushq   %rdi
        pushq   %rbx
        subq    $408, %rsp              # imm = 0x198
        leaq    128(%rsp), %rbp
        movaps  %xmm15, 256(%rbp)       # 16-byte Spill
        movdqa  %xmm14, 240(%rbp)       # 16-byte Spill
        movaps  %xmm13, 224(%rbp)       # 16-byte Spill
        movaps  %xmm12, 208(%rbp)       # 16-byte Spill
        movdqa  %xmm11, 192(%rbp)       # 16-byte Spill
        movaps  %xmm10, 176(%rbp)       # 16-byte Spill
        movaps  %xmm9, 160(%rbp)        # 16-byte Spill
        movaps  %xmm8, 144(%rbp)        # 16-byte Spill
        movaps  %xmm7, 128(%rbp)        # 16-byte Spill
        movaps  %xmm6, 112(%rbp)        # 16-byte Spill


If I add the flag -mattr=+avx, I get this instead:

        pushq   %rbp
        pushq   %r15
        pushq   %r14
        pushq   %r13
        pushq   %r12
        pushq   %rsi
        pushq   %rdi
        pushq   %rbx
        subq    $480, %rsp              # imm = 0x1E0
        leaq    128(%rsp), %rbp
        vmovaps %xmm15, 336(%rbp)       # 16-byte Spill
        vmovaps %xmm14, 320(%rbp)       # 16-byte Spill
        vmovaps %xmm13, 304(%rbp)       # 16-byte Spill
        vmovaps %xmm12, 288(%rbp)       # 16-byte Spill
        vmovdqa %xmm11, 272(%rbp)       # 16-byte Spill
        vmovaps %xmm10, 256(%rbp)       # 16-byte Spill
        vmovaps %xmm9, 240(%rbp)        # 16-byte Spill
        vmovaps %xmm8, 224(%rbp)        # 16-byte Spill
        vmovdqa %xmm7, 208(%rbp)        # 16-byte Spill
        vmovaps %xmm6, 192(%rbp)        # 16-byte Spill

Those movaps instructions are all misaligned by 8 bytes (and indeed it
crashes).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150212/f4ad1a6f/attachment.html>


More information about the llvm-bugs mailing list