Fix an index calculation thinko.
authorDan Gohman <gohman@apple.com>
Sat, 28 Aug 2010 00:39:27 +0000 (00:39 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 28 Aug 2010 00:39:27 +0000 (00:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112337 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index 9afa0bd02b59727993e4085c8f6b88e407f2fc74..9bc3aa93539ad8480e2886e5ee0431af07c42c42 100644 (file)
@@ -1430,7 +1430,7 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
         return Mul;
       Ops[i] = Mul;
       Ops.erase(Ops.begin()+i+1, Ops.begin()+i+Count);
-      i -= Count - 1; e -= Count - 1;
+      --i; e -= Count - 1;
       FoundMatch = true;
     }
   if (FoundMatch)