summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-28 05:28:31 +0000
committerChris Lattner <sabre@nondot.org>2010-03-28 05:28:31 +0000
commite01f7e33ac24e040cd4c61874299a7cc33c3b8f4 (patch)
treee4dccc5ccae1ad9d0717a0721c939137d1c25913 /llvm/lib/CodeGen/SelectionDAG
parenta520b166dc7976048713f708438b77ddfae653b4 (diff)
downloadbcm5719-llvm-e01f7e33ac24e040cd4c61874299a7cc33c3b8f4.tar.gz
bcm5719-llvm-e01f7e33ac24e040cd4c61874299a7cc33c3b8f4.zip
don't add nodes to the now-dead nodes list multiple times, this
can cause a crash on crazy situations in msp430 when morph-node-to is disabled. llvm-svn: 99739
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 600557eddfd..3981826f59a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -1592,8 +1592,9 @@ UpdateChainsAndFlags(SDNode *NodeToMatch, SDValue InputChain,
assert(ChainVal.getValueType() == MVT::Other && "Not a chain?");
CurDAG->ReplaceAllUsesOfValueWith(ChainVal, InputChain, &ISU);
- // If the node became dead, delete it.
- if (ChainNode->use_empty())
+ // If the node became dead and we haven't already seen it, delete it.
+ if (ChainNode->use_empty() &&
+ !std::count(NowDeadNodes.begin(), NowDeadNodes.end(), ChainNode))
NowDeadNodes.push_back(ChainNode);
}
}
OpenPOWER on IntegriCloud