From: Chris Lattner Date: Wed, 30 Nov 2005 20:40:54 +0000 (+0000) Subject: Fix Regression/CodeGen/PowerPC/2005-11-30-vastart-crash.ll X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=80720a921987e36c83236d375919172afd20d79c;p=oota-llvm.git Fix Regression/CodeGen/PowerPC/2005-11-30-vastart-crash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24547 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 1ef1d3e9d0e..0f7afbc7fbf 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -434,7 +434,8 @@ PPCTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { needsLoad = true; } break; - case MVT::i64: ObjSize = 8; + case MVT::i64: + ObjSize = 8; if (!ArgLive) break; if (GPR_remaining > 0) { SDOperand argHi, argLo; @@ -530,7 +531,10 @@ PPCTargetLowering::LowerArguments(Function &F, SelectionDAG &DAG) { SDOperand PtrOff = DAG.getConstant(4, getPointerTy()); FIN = DAG.getNode(ISD::ADD, MVT::i32, FIN, PtrOff); } - DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, MemOps)); + if (!MemOps.empty()) { + MemOps.push_back(DAG.getRoot()); + DAG.setRoot(DAG.getNode(ISD::TokenFactor, MVT::Other, MemOps)); + } } // Finally, inform the code generator which regs we return values in.