<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - misaligned callee save of xmm registers on windows when avx enabled"
   href="http://llvm.org/bugs/show_bug.cgi?id=22572">22572</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>misaligned callee save of xmm registers on windows when avx enabled
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>andrew.b.adams@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=13858" name="attach_13858" title="Broken ll">attachment 13858</a> <a href="attachment.cgi?id=13858&action=edit" title="Broken ll">[details]</a></span>
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).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>