From: Devang Patel Date: Wed, 15 Sep 2010 18:13:55 +0000 (+0000) Subject: Check bb to ensure that alloca is in separate basic block. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=27ede1ba6daa893557db477fe3252084fd9f6147;p=oota-llvm.git Check bb to ensure that alloca is in separate basic block. This fixes funcargs.exp regression reported by gdb testsuite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113992 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index db3ca111738..b29a5b5ffec 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -4122,13 +4122,15 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { // If variable is pinned by a alloca in dominating bb then // use StaticAllocaMap. if (const AllocaInst *AI = dyn_cast(Address)) { - DenseMap::iterator SI = - FuncInfo.StaticAllocaMap.find(AI); - if (SI != FuncInfo.StaticAllocaMap.end()) { - SDV = DAG.getDbgValue(Variable, SI->second, - 0, dl, SDNodeOrder); - DAG.AddDbgValue(SDV, 0, false); - return 0; + if (AI->getParent() != DI.getParent()) { + DenseMap::iterator SI = + FuncInfo.StaticAllocaMap.find(AI); + if (SI != FuncInfo.StaticAllocaMap.end()) { + SDV = DAG.getDbgValue(Variable, SI->second, + 0, dl, SDNodeOrder); + DAG.AddDbgValue(SDV, 0, false); + return 0; + } } } // Otherwise add undef to help track missing debug info.