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)
commita5360c4cd887413c386ea678784ab08011764191
tree8f2892a67b148be41b1013bad29ca9b412c29a25
parent89ea9610b3061c4a897fedbe3bec319723e43066
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.

llvm-svn: 211040
llvm/lib/Target/X86/X86FastISel.cpp
llvm/test/CodeGen/X86/x86-64-static-relo-movl.ll [new file with mode: 0644]
llvm/test/DebugInfo/X86/debug-loc-asan.ll