[LLVMbugs] [Bug 20052] New: __declspec(naked) functions run out of registers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 16 10:58:17 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20052

            Bug ID: 20052
           Summary: __declspec(naked) functions run out of registers
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jmuizelaar at mozilla.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140616/f3b39cf4/attachment.html>


More information about the llvm-bugs mailing list