From: Vikram S. Adve Date: Sat, 28 Sep 2002 17:02:40 +0000 (+0000) Subject: Fixed incorrect assertion: spill code for function ptr should be X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ad9c978874e02deff86257ad23de8e60069f84d9;p=oota-llvm.git Fixed incorrect assertion: spill code for function ptr should be handled like normal operands, not like other call arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3967 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp index 6092053135e..bd87ec91aad 100644 --- a/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp +++ b/lib/CodeGen/RegAlloc/PhyRegAlloc.cpp @@ -592,9 +592,10 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR, const BasicBlock *BB, const unsigned OpNum) { - assert(! TM.getInstrInfo().isCall(MInst->getOpCode()) && - (! TM.getInstrInfo().isReturn(MInst->getOpCode())) && - "Arg of a call/ret must be handled elsewhere"); + assert((! TM.getInstrInfo().isCall(MInst->getOpCode()) || OpNum == 0) && + "Outgoing arg of a call must be handled elsewhere (func arg ok)"); + assert(! TM.getInstrInfo().isReturn(MInst->getOpCode()) && + "Return value of a ret must be handled elsewhere"); MachineOperand& Op = MInst->getOperand(OpNum); bool isDef = MInst->operandIsDefined(OpNum); diff --git a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp index 6092053135e..bd87ec91aad 100644 --- a/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp +++ b/lib/Target/SparcV9/RegAlloc/PhyRegAlloc.cpp @@ -592,9 +592,10 @@ void PhyRegAlloc::insertCode4SpilledLR(const LiveRange *LR, const BasicBlock *BB, const unsigned OpNum) { - assert(! TM.getInstrInfo().isCall(MInst->getOpCode()) && - (! TM.getInstrInfo().isReturn(MInst->getOpCode())) && - "Arg of a call/ret must be handled elsewhere"); + assert((! TM.getInstrInfo().isCall(MInst->getOpCode()) || OpNum == 0) && + "Outgoing arg of a call must be handled elsewhere (func arg ok)"); + assert(! TM.getInstrInfo().isReturn(MInst->getOpCode()) && + "Return value of a ret must be handled elsewhere"); MachineOperand& Op = MInst->getOperand(OpNum); bool isDef = MInst->operandIsDefined(OpNum);