From a2d2adfa4ee8b16d7f2828ff69bab5b217dbcb83 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Mon, 20 Jul 2009 23:39:13 +0000 Subject: [PATCH] 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) llvm-svn: 76503 --- llvm/lib/Target/X86/X86ISelLowering.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index c20a62665854..7ce51b323ca7 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -4557,7 +4557,7 @@ X86TargetLowering::LowerGlobalAddress(const GlobalValue *GV, DebugLoc dl, SDValue Result; if (OpFlags == X86II::MO_NO_FLAG && isInt32(Offset)) { // A direct static reference to a global. - Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset); + Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), Offset, OpFlags); Offset = 0; } else { Result = DAG.getTargetGlobalAddress(GV, getPointerTy(), 0, OpFlags); @@ -8911,10 +8911,7 @@ void X86TargetLowering::LowerAsmOperandForConstraint(SDValue Op, getTargetMachine()))) return; - if (hasMemory) - Op = LowerGlobalAddress(GV, Op.getDebugLoc(), Offset, DAG); - else - Op = DAG.getTargetGlobalAddress(GV, GA->getValueType(0), Offset); + Op = LowerGlobalAddress(GV, Op.getDebugLoc(), Offset, DAG); Result = Op; break; }