Fix a problem discovered on self host.
authorChris Lattner <sabre@nondot.org>
Fri, 6 Nov 2009 19:21:48 +0000 (19:21 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 6 Nov 2009 19:21:48 +0000 (19:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86278 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/JumpThreading.cpp
test/Transforms/JumpThreading/crash.ll

index f52110f8851321850ad7720dafa89e09a44c5c6e..4918b73c5fd559cc8e86d9ca135085b21aa35e30 100644 (file)
@@ -267,7 +267,7 @@ ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,PredValueInfo &Result){
     ConstantInt *CI = dyn_cast<ConstantInt>(V);
     Result.resize(TheFirstPHI->getNumIncomingValues());
     for (unsigned i = 0, e = Result.size(); i != e; ++i)
-      Result.push_back(std::make_pair(CI, TheFirstPHI->getIncomingBlock(i)));
+      Result[i] = std::make_pair(CI, TheFirstPHI->getIncomingBlock(i));
     return true;
   }
   
index 862b40378bcd0d375491e617785be79e02e66abd..7e2a2a047d111e74beb52018cf3bc112c9fc62ba 100644 (file)
@@ -170,3 +170,25 @@ bb32.i:
         ret i32 1
 }
 
+
+define fastcc void @test5(i1 %tmp, i32 %tmp1) nounwind ssp {
+entry:
+  br i1 %tmp, label %bb12, label %bb13
+
+
+bb12:                                            
+  br label %bb13
+
+bb13:                                            
+  %.lcssa31 = phi i32 [ undef, %bb12 ], [ %tmp1, %entry ]
+  %A = and i1 undef, undef
+  br i1 %A, label %bb15, label %bb61
+
+bb15:                                            
+  ret void
+
+
+bb61:                                            
+  ret void
+}
+