From b253a8b382824586066a299e1279838f41117e3b Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 29 Dec 2007 07:15:45 +0000 Subject: [PATCH] make sure not to zap volatile stores, thanks a lot to Dale for noticing this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45402 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 0ee45575633..cfa46e6b591 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4252,7 +4252,8 @@ SDOperand DAGCombiner::visitSTORE(SDNode *N) { if (LoadSDNode *Ld = dyn_cast(Value)) { if (Chain.Val == Ld && Ld->getBasePtr() == Ptr && ST->getAddressingMode() == ISD::UNINDEXED && - ST->getStoredVT() == Ld->getLoadedVT()) { + ST->getStoredVT() == Ld->getLoadedVT() && + !ST->isVolatile()) { // The store is dead, remove it. return Chain; } -- 2.34.1