<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 --- - __declspec(naked) functions run out of registers"
   href="http://llvm.org/bugs/show_bug.cgi?id=20052">20052</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>__declspec(naked) functions run out of registers
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>jmuizelaar@mozilla.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>The following function (reduced from some nss code) builds with cl but not with
clang-cl


int  s_mpi_is_sse2();
__declspec(naked)
void s_mpv_mul_d(   )
{
  __asm {
    call   s_mpi_is_sse2
    lodsd                       ;  [] 
    mov    edx,[0]               
    mov    ebx,0                       
    stosd                       ; []  
    dec    ecx                   
  }
}   


In this case we emit code that does the following for the call

    0:    bf 00 00 00 00                                   movl    $0, %edi
    5:    ff d7                                            calll    *%edi

We should really be doing this call directly instead of doing it indirectly.
This would save us from needing the extra registers.</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>