mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-13 08:26:02 +00:00
Make sure a global matching asm 'i' constraint gets its
flags set properly. (hasMemory is clearly irrelevant when matching 'i', I don't understand what this was supposed to be doing.) gcc.apple/asm-block-25.c (test passed before by accident, but generated code was wrong) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76503 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -4557,7 +4557,7 @@ X86TargetLowering::LowerGlobalAddress(const GlobalValue *GV, DebugLoc dl,
|
|||||||
SDValue Result;
|
SDValue Result;
|
||||||
if (OpFlags == X86II::MO_NO_FLAG && isInt32(Offset)) {
|
if (OpFlags == X86II::MO_NO_FLAG && isInt32(Offset)) {
|
||||||
// A direct static reference to a global.
|
// A direct static reference to a global.
|
||||||
Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset);
|
Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset, OpFlags);
|
||||||
Offset = 0;
|
Offset = 0;
|
||||||
} else {
|
} else {
|
||||||
Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), 0, OpFlags);
|
Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), 0, OpFlags);
|
||||||
@@ -8911,10 +8911,7 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op,
|
|||||||
getTargetMachine())))
|
getTargetMachine())))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (hasMemory)
|
|
||||||
Op = LowerGlobalAddress(GV, Op.getDebugLoc(), Offset, DAG);
|
Op = LowerGlobalAddress(GV, Op.getDebugLoc(), Offset, DAG);
|
||||||
else
|
|
||||||
Op = DAG.getTargetGlobalAddress(GV, GA->getValueType(0), Offset);
|
|
||||||
Result = Op;
|
Result = Op;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user