Fix illegal relocations in X86FastISel
authorLouis Gerbarg <lgg@apple.com>
Mon, 16 Jun 2014 17:35:40 +0000 (17:35 +0000)
committerLouis Gerbarg <lgg@apple.com>
Mon, 16 Jun 2014 17:35:40 +0000 (17:35 +0000)
commita564159d85ead67f5bea1d6fda1b7e261db23825
tree679486391fecc078686a687bce2e67f14a473e30
parentdc2dc390f65ecc3b769c806cfc40b14fd42eed91
Fix illegal relocations in X86FastISel

On x86_86  the lea instruction can only use a 32 bit immediate value. When
the code is compiled statically the RIP register is not used, meaning the
immediate is all that can be used for the relocation, which is not sufficient
in the case of targets more than +/- 2GB away. This patch bails out of fast
isel in those cases and reverts to DAG which does the right thing.

Test case included.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211040 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FastISel.cpp
test/CodeGen/X86/x86-64-static-relo-movl.ll [new file with mode: 0644]
test/DebugInfo/X86/debug-loc-asan.ll