[LLVMbugs] [Bug 3773] New: Wrong encoding of a call instruction when JITing on x86

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Mar 10 06:34:58 PDT 2009


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

           Summary: Wrong encoding of a call instruction when JITing on x86
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicolas.geoffray at lip6.fr
                CC: llvmbugs at cs.uiuc.edu


The following (useless and bugous) .ll program:

define void @main() {
start:
        call void inttoptr (i64 0 to void ()*)()
        ret void
}

Generates a wrong code when jitting on linux/x86 (and probably darwin/x86).
With llvm-svn, the result is:

JIT: Finished CodeGen of [0xb6d4f010] Function: main: 12 bytes of text, 0
relocations
JIT: Disassembled code:
b6d4f010:       sub $0x4, %esp
b6d4f013:       inc (%eax)
b6d4f015:       add %al, (%eax)
b6d4f017:       invalid 
JIT: Binary code:
JIT: 00000000: ff04ec83 00000000 c304c483 


With llvm-2.5, the result was:

JIT: Finished CodeGen of [0xb6d42010] Function: main: 11 bytes of text, 0
relocations
JIT: Disassembled code:
b6d42010:       sub $0x4, %esp
b6d42013:       xor %eax, %eax
b6d42015:       call %eax
b6d42017:       add $0x4, %esp
b6d4201a:       ret 
JIT: Binary code:
JIT: 00000000: 3104ec83 83d0ffc0 c304c4


-- 
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