Don't accept globals as matching 'i' constraint

in PIC modes (in accordance with existing comment).
gcc.apple/asm-block-25.c

llvm-svn: 74886
This commit is contained in:
Dale Johannesen 2009-07-07 00:18:49 +00:00
parent 619bba465f
commit 5487047295

View File

@ -8803,10 +8803,15 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
continue; continue;
} }
} }
// Otherwise, this isn't something we can handle, reject it. // Otherwise, this isn't something we can handle, reject it.
return; return;
} }
// If we require an extra load to get this address, as in PIC mode, we
// can't accept it.
if (Subtarget->GVRequiresExtraLoad(GA->getGlobal(),
getTargetMachine(), false))
return;
if (hasMemory) if (hasMemory)
Op = LowerGlobalAddress(GA->getGlobal(), Op.getDebugLoc(), Offset, DAG); Op = LowerGlobalAddress(GA->getGlobal(), Op.getDebugLoc(), Offset, DAG);