<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - [X86] mstackrealign takes up extra register"
   href="https://bugs.llvm.org/show_bug.cgi?id=37542">37542</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[X86] mstackrealign takes up extra register
          </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>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>pirama@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Filing issue <a href="https://github.com/android-ndk/ndk/issues/693">https://github.com/android-ndk/ndk/issues/693</a> reported against the
Android NDK.

-mstackrealign causes the register allocator to run out of registers for inline
assembly.  Is this expected?  Here's a smaller reproducer produced with
CReduce:

$ cat > test.c
#define a(b, c, d, f, e, h, g, j, i, byte, end, l, k, n, m) ""
# 1 "" 3
p, o, q, r, s, t;
u() {
  __asm__(a(, , , , , , , , , , , , , , ) a(, , , , , , , , , , , , , , )
          : "=&q"(r), "+m"(o), "+&r"(t), "=&r"(q), "+&r"(t), "=&r"(s)
          : "m"(p));
}

$ clang "-cc1" "-triple" "i686-none-linux-android" "-emit-obj" "-mstackrealign"
"-x" "c" test.c
:3:11: error: inline assembly requires more registers than available
  __asm__(a(, , , , , , , , , , , , , , ) a(, , , , , , , , , , , , , , )
          ^
h264_cabac-21c918.c:1:61: note: expanded from macro 'a'
#define a(b, c, d, f, e, h, g, j, i, byte, end, l, k, n, m) ""
                                                            ^
1 error generated.

$ clang "-cc1" "-triple" "i686-none-linux-android" "-emit-obj" "-x" "c" test.c
<no error></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>