Fix for PR1062 by Dan Gohman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32688 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp
index 5c0bd28..863e6d8 100644
--- a/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -604,11 +604,9 @@
SDOperand N0 = N.getOperand(0);
if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(N0)) {
GlobalValue *GV = G->getGlobal();
- bool isAbs32 = !is64Bit ||
- (isStatic && !(GV->isExternal() || GV->hasWeakLinkage() ||
- GV->hasLinkOnceLinkage()));
+ bool isAbs32 = !is64Bit || isStatic;
if (isAbs32 || isRoot) {
- AM.GV = G->getGlobal();
+ AM.GV = GV;
AM.Disp += G->getOffset();
AM.isRIPRel = !isAbs32;
return false;