[LLVMbugs] [Bug 3666] X86 backend converts calls to constant addresses to indirect calls.

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Nov 16 01:28:23 PST 2009


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


tobias <ubub at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ubub at gmx.net
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




--- Comment #5 from tobias <ubub at gmx.net>  2009-11-16 03:28:22 ---
When upgrading from 2.5 to 2.6 this patch seems to break stuff:

llvm 2.5 outputs the following assembly:
movl    $12345678, %eax
call    *%eax
this is correct, but indirect, as documented in the initial comment.

the initial comment says that llvm 2.6 _should_ output:
call    *12345678
the above assembly calls the function pointer _stored_ at address 12345678.
this is not the same as calling the function at address 12345678, which is what
the IR would like to do.

actually llvm 2.6 outputs the following assembly:
call    12345678
the above assembly calls the function pointer relative to the current program
counter (IPC+12345678 -> crash). this is not the same as calling the function
at the absolute address 12345678, which is what the IR would like to do.

perhaps someone with good x86 at&t assembly knowledge can shed some light on
it.
I have already tried:
call    12345678 - . - 1
this works but I don't know if it is fully relocatable when linked as a shared
library.


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