summaryrefslogtreecommitdiff
path: root/devel/llvm29/files/patch-lib_Transforms_Scalar_LoopUnroll.cpp
blob: a2ea96188a3053ae6aa0613af84d1f8ebe8e4bc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$FreeBSD$

--- lib/Transforms/Scalar/LoopUnroll.cpp.orig
+++ lib/Transforms/Scalar/LoopUnroll.cpp
@@ -365,8 +365,9 @@
       // be updated specially after unrolling all the way.
       if (*BB != LatchBlock)
         for (Value::use_iterator UI = (*BB)->use_begin(), UE = (*BB)->use_end();
-             UI != UE; ++UI) {
+             UI != UE;) {
           Instruction *UseInst = cast<Instruction>(*UI);
+	  ++UI;
           if (isa<PHINode>(UseInst) && !L->contains(UseInst->getParent())) {
             PHINode *phi = cast<PHINode>(UseInst);
             Value *Incoming = phi->getIncomingValueForBlock(*BB);