summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-06-24 20:14:51 +0000
committerDale Johannesen <dalej@apple.com>2010-06-24 20:14:51 +0000
commit5ad5226c58c84b15268bb0f54f797429d0974ace (patch)
tree49796583a46b75fa2fbc4882a56d6b82825bcbb3 /llvm/lib/Target
parenta0d44f9c624b5a0a9d53a29b125d73184ac6e530 (diff)
downloadbcm5719-llvm-5ad5226c58c84b15268bb0f54f797429d0974ace.tar.gz
bcm5719-llvm-5ad5226c58c84b15268bb0f54f797429d0974ace.zip
Disallow matching "i" constraint to symbol addresses when
address requires a register or secondary load to compute (most PIC modes). This improves "g" constraint handling. 8015842. The test from 2007 is attempting to test the fix for PR1761, but since -relocation-model=static doesn't work on Darwin x86-64, it was not testing what it was supposed to be testing and was passing erroneously. Fixed to use Linux x86-64. llvm-svn: 106779
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index da10a6f2cad..bed9d1d1a82 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -10222,6 +10222,13 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
break;
}
+ // In any sort of PIC mode addresses need to be computed at runtime by
+ // adding in a register or some sort of table lookup. These can't
+ // be used as immediates.
+ if (Subtarget->isPICStyleGOT() || Subtarget->isPICStyleStubPIC() ||
+ Subtarget->isPICStyleRIPRel())
+ return;
+
// If we are in non-pic codegen mode, we allow the address of a global (with
// an optional displacement) to be used with 'i'.
GlobalAddressSDNode *GA = 0;
OpenPOWER on IntegriCloud