mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
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
This commit is contained in:
parent
97c8c51f07
commit
4f06649497
@ -4453,7 +4453,7 @@ X86TargetLowering::LowerConstantPool(SDValue Op, SelectionDAG &DAG) {
|
||||
unsigned char OpFlag = 0;
|
||||
unsigned WrapperKind = X86ISD::Wrapper;
|
||||
|
||||
if (Subtarget->is64Bit() &&
|
||||
if (Subtarget->isPICStyleRIPRel() &&
|
||||
getTargetMachine().getCodeModel() == CodeModel::Small)
|
||||
WrapperKind = X86ISD::WrapperRIP;
|
||||
else if (Subtarget->isPICStyleGOT())
|
||||
@ -4485,7 +4485,7 @@ SDValue X86TargetLowering::LowerJumpTable(SDValue Op, SelectionDAG &DAG) {
|
||||
unsigned char OpFlag = 0;
|
||||
unsigned WrapperKind = X86ISD::Wrapper;
|
||||
|
||||
if (Subtarget->is64Bit() &&
|
||||
if (Subtarget->isPICStyleRIPRel() &&
|
||||
getTargetMachine().getCodeModel() == CodeModel::Small)
|
||||
WrapperKind = X86ISD::WrapperRIP;
|
||||
else if (Subtarget->isPICStyleGOT())
|
||||
@ -4517,7 +4517,7 @@ X86TargetLowering::LowerExternalSymbol(SDValue Op, SelectionDAG &DAG) {
|
||||
// global base reg.
|
||||
unsigned char OpFlag = 0;
|
||||
unsigned WrapperKind = X86ISD::Wrapper;
|
||||
if (Subtarget->is64Bit() &&
|
||||
if (Subtarget->isPICStyleRIPRel() &&
|
||||
getTargetMachine().getCodeModel() == CodeModel::Small)
|
||||
WrapperKind = X86ISD::WrapperRIP;
|
||||
else if (Subtarget->isPICStyleGOT())
|
||||
@ -4561,7 +4561,7 @@ X86TargetLowering::LowerGlobalAddress(const GlobalValue *GV, DebugLoc dl,
|
||||
Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), 0, OpFlags);
|
||||
}
|
||||
|
||||
if (Subtarget->is64Bit() &&
|
||||
if (Subtarget->isPICStyleRIPRel() &&
|
||||
getTargetMachine().getCodeModel() == CodeModel::Small)
|
||||
Result = DAG.getNode(X86ISD::WrapperRIP, dl, getPointerTy(), Result);
|
||||
else
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user