http://llvm.org/bugs/show_bug.cgi?id=3666
Summary: X86 backend converts calls to constant addresses to
indirect calls.
Product: libraries
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Backend: X86
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
The following llvm code:
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i386-pc-linux-gnu"
define i32 @main() nounwind {
entry:
%0 = call i32 inttoptr (i32 12345678 to i32 (i32)*)(i32 0) nounwind
; <i32> [#uses=1]
ret i32 %0
}
Produces the following assembler (with directives removed)
main:
subl $4, %esp
movl $0, (%esp)
movl $12345678, %eax
call *%eax
addl $4, %esp
ret
Whereas it should produce this code:
main:
subl $4, %esp
movl $0, (%esp)
call *12345678
addl $4, %esp
ret
This is important since all calls in JIT compiled code, will be in the above
form.
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs