[llvm-commits] [llvm] r60739 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Chris Lattner sabre at nondot.org
Mon Dec 8 20:47:23 PST 2008


Author: lattner
Date: Mon Dec  8 22:47:21 2008
New Revision: 60739

URL: http://llvm.org/viewvc/llvm-project?rev=60739&view=rev
Log:
Fix a really subtle off-by-one bug that Duncan noticed with valgrind
on test/CodeGen/Generic/2007-06-06-CriticalEdgeLandingPad.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=60739&r1=60738&r2=60739&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Mon Dec  8 22:47:21 2008
@@ -249,7 +249,7 @@
   for (unsigned i = 0, e = DeadInsts.size()-1; i < e; ++i) {
     Instruction *I = DeadInsts[i];
     if (!I->use_empty()) DeadInsts[i] = 0;
-    while (DeadInsts[i+1] == I && i != e)
+    while (i != e && DeadInsts[i+1] == I)
       DeadInsts[++i] = 0;
   }
   





More information about the llvm-commits mailing list