Fix PR4533, which is about buggy codegen in x86-64 -static mode.
authorChris Lattner <sabre@nondot.org>
Sat, 11 Jul 2009 20:29:19 +0000 (20:29 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 11 Jul 2009 20:29:19 +0000 (20:29 +0000)
commit4f0664949729778a3551970cd74e976f0d9a046f
treee3821d42b194d2c39a7090ac84d66ae4e303287d
parent97c8c51f075ff49b1f67f6d7d31969212d72512b
Fix PR4533, which is about buggy codegen in x86-64 -static mode.
Basically, using:
  lea symbol(%rip), %rax

is not valid in -static mode, because the current RIP may not be
within 32-bits of "symbol" when an app is built partially pic and
partially static.  The fix for this is to compile it to:

  lea symbol, %rax

It would be better to codegen this as:

  movq $symbol, %rax

but that will come next.

The hard part of fixing this bug was fixing abi-isel, which was actively
testing for the wrong behavior.  Also, the RUN lines are completely impossible
to understand what they are testing.  To help with this, convert the -static
x86-64 codegen tests to use filecheck.  This is much more stable and makes it
more clear what the codegen is expected to be.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75382 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/abi-isel.ll