<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 --- - Incorrect code generated for dynamic alloca with alignment"
   href="http://llvm.org/bugs/show_bug.cgi?id=17345">17345</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect code generated for dynamic alloca with alignment
          </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>Linux
          </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>zvi.rackover@intel.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>For the following test,

define i32 @A(i32 %Size) {
entry:
  %A = alloca i8, i32 %Size, align 128
  %A_addr = ptrtoint i8* %A to i32
  ret i32 %A_addr
}

llc -mtriple=x86_64-linux generates:
1:        pushq   %rbp
2:        movq    %rsp, %rbp
3:        pushq   %rbx
4:        andq    $-128, %rsp
5:        subq    $128, %rsp
6:        movq    %rsp, %rbx
7:        movq    %rsp, %rax
8:        andq    $-128, %rax
9:        movl    %edi, %ecx
10:       addq    $15, %rcx
11:       andq    $-16, %rcx
12:       subq    %rcx, %rax
13:       movq    %rax, %rsp
14:       leaq    -8(%rbp), %rsp
15:       popq    %rbx
16:       popq    %rbp
17:       ret

There is no guarantee that the returned value in %rax will be a multiple of
128, which is the required alignment (but it will be a multiple of 16).</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>