[LLVMbugs] [Bug 2839] New: C Backend does not handle inline assembly correctly.

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Sep 29 12:16:51 PDT 2008


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

           Summary: C Backend does not handle inline assembly correctly.
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: C
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: haohui.mai at gmail.com
                CC: llvmbugs at cs.uiuc.edu


The LLVM IR is the following:

define void @test() nounwind {
  tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags},~{memory}"()  
  nounwind
  ret void
}

Here is the generated C code:

void test() { 
   __asm__ volatile ("" 
         : 
         :"memory"); 
   return; 
} 

It should be __asm__ volative("":::"memory").

The generated code lacks a colon that make the C code failed to compile.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list