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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to