SDValue Result;
if (OpFlags == X86II::MO_NO_FLAG && isInt32(Offset)) {
// A direct static reference to a global.
- Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset, OpFlags);
+ Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset);
Offset = 0;
} else {
Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), 0, OpFlags);
getTargetMachine())))
return;
- Op = LowerGlobalAddress(GV, Op.getDebugLoc(), Offset, DAG);
+ if (hasMemory)
+ Op = LowerGlobalAddress(GV, Op.getDebugLoc(), Offset, DAG);
+ else
+ Op = DAG.getTargetGlobalAddress(GV, GA->getValueType(0), Offset);
Result = Op;
break;
}