Store nodes only have 1 result.
[oota-llvm.git] / lib / CodeGen / SelectionDAG / DAGCombiner.cpp
index a9ba5b87bb90e334c898f1de1997981a1b60ce61..275790f37c0c42dd2cba9940867aec9787319fd1 100644 (file)
@@ -9119,7 +9119,7 @@ bool DAGCombiner::MergeConsecutiveStores(StoreSDNode* St) {
   StoreSDNode *Index = St;
   while (Index) {
     // If the chain has more than one use, then we can't reorder the mem ops.
-    if (Index != St && !SDValue(Index, 1)->hasOneUse())
+    if (Index != St && !SDValue(Index, 0)->hasOneUse())
       break;
 
     // Find the base pointer and offset for this memory node.