diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index 871ed0e82b56..5ea12aa96115 100644 --- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -628,19 +628,19 @@ bool X86DAGToDAGISel::MatchAddress(SDOperand N, X86ISelAddressMode &AM, AM.CP = CP->getConstVal(); AM.Align = CP->getAlignment(); AM.Disp += CP->getOffset(); - AM.isRIPRel = !isStatic; + AM.isRIPRel = !isAbs32; return false; } } else if (ExternalSymbolSDNode *S =dyn_cast(N0)) { if (isAbs32 || isRoot) { AM.ES = S->getSymbol(); - AM.isRIPRel = !isStatic; + AM.isRIPRel = !isAbs32; return false; } } else if (JumpTableSDNode *J = dyn_cast(N0)) { if (isAbs32 || isRoot) { AM.JT = J->getIndex(); - AM.isRIPRel = !isStatic; + AM.isRIPRel = !isAbs32; return false; } }