<html>
    <head>
      <base href="https://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 placement of function arguments of over-aligned type on the stack (ABI incompatibility)"
   href="https://llvm.org/bugs/show_bug.cgi?id=26830">26830</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>misaligned placement of function arguments of over-aligned type on the stack (ABI incompatibility)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.7
          </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>-New Bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>kretz@kde.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Testcase:
#include <xmmintrin.h>
struct X { __m128 x; };
X f(X a, X b) { return {_mm_add_ps(a.x, b.x)}; }

Compiles to (-msse -m32 -O2):
00000000 <f(X, X)>:
   0:·       mov    0x4(%esp),%eax
   4:·       movups 0x8(%esp),%xmm0
   9:·       movups 0x18(%esp),%xmm1
   e:·       addps  %xmm0,%xmm1
  11:·       movaps %xmm1,(%eax)
  14:·       ret    $0x4

This is incorrect according to the x86 psABI document, which states that
padding must be added so that the placement of the argument matches its
alignment. GCC compiles the code to:
00000000 <f(X, X)>:
   0:·       movaps 0x24(%esp),%xmm0
   5:·       mov    0x4(%esp),%eax
   9:·       addps  0x14(%esp),%xmm0
   e:·       movaps %xmm0,(%eax)
  11:·       ret    $0x4</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>