[LLVMbugs] [Bug 6429] x86_64 JIT emits PC-relative relocation in non-PC-relative instruction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 8 19:04:16 PST 2010


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

Dan Gohman <gohman at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #13 from Dan Gohman <gohman at apple.com> 2010-03-08 21:04:16 CST ---
I was curious how the JIT copes with code like

    x ? 0.1 : 2.3

because this typically codegens as LCPI(,%rax,8), and it's not possible to
encode addresses using the scaled index with RIP.  The answer is that the JIT
defaults to the large code model, so the symbol gets emitted in a MOV64ri,
which bypasses this issue.

Given that, the bigger problem here is that that X86InstrInfo.cpp code wasn't
aware of the code model.  This is now fixed on trunk in r98042.

It's also the case that the binary code emitter will need more information (a
TargetFlag bit on the MachineOperand?) in order to be able to emit
non-PC-relative encodings, but that's a separate issue.

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