[LLVMbugs] [Bug 2785] New: Incorrect C code produced by llc

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Sep 10 11:51:22 PDT 2008


           Summary: Incorrect C code produced by llc
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: akasim at swri.org
                CC: llvmbugs at cs.uiuc.edu

Arif Kasim <akasim at swri.org> changed:

           What    |Removed                     |Added
            Summary|Incorrect C code produce by |Incorrect C code produced by
                   |llc                         |llc

When I convert llvm bytecode to c using the following command:
llc -march=c file.bc file.c

I'm getting some c statements which are not compilable (and/or does not make
sense). Here is one such statement:
__asm__ volatile ("btl %1,%2 ; setcb %b0"

note that llvm_cbe_asmtmp is unsigned char and llvm_cbe_tmp5 is unsigned int. 

Shouldn't the code more be along the lines of  :

 __asm__ volatile ("btl %1,%2 ; setcb %b0"
        :"r"(llvm_cbe_tmp5), "m"((llvm_cbe_tmp5))

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