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; }