[LLVMbugs] [Bug 2689] New: x86 32-bit linux codegen error with inttoptr calls
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Fri Aug 15 17:17:42 PDT 2008
http://llvm.org/bugs/show_bug.cgi?id=2689
Summary: x86 32-bit linux codegen error with inttoptr calls
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: blocker
Priority: P2
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: llvm at pixelperplexity.net
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=1936)
--> (http://llvm.org/bugs/attachment.cgi?id=1936)
The reduced problematic case
There's a codegen error with calls to inttoptr functions on linux in x86 32 bit
land. This blocks my work but probably no one else has noticed because it only
happens on linux and when you make calls to addresses you hand in manually.
I've attached a file (proc.bc) that has contents like this:
define void @main(i8* %ptr) {
%result1 = call float inttoptr (i32 -1209486080 to float (float)*)(
float 0.000000e+00 )
%writeme1 = insertelement <4 x float> undef, float %result1, i32 0
%result2 = call float inttoptr (i32 -1209486080 to float (float)*)(
float 0x3FF921FB60000000 )
%writeme2 = insertelement <4 x float> %writeme1, float %result2, i32 1
%writeptr = bitcast i8* %ptr to <4 x float>*
store <4 x float> %writeme2, <4 x float>* %writeptr, align 1
ret void
}
and when I code gen this using llc ("llc proc.bc") I get code which includes
the following segment:
movl $3085481216, %esi
call *%esi
fstps (%esp)
movl $1070141403, (%esp)
call *%esi
The second movl call overwrites the return value from the first call
instruction and it's gone forever.
For example, the same thing run through llc on Mac OS X Leopard 32-bit
produces:
movl $3085481216, %esi
call *%esi
fstps 16(%esp)
movl $1070141403, (%esp)
call *%esi
Which works fine.
--
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