diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0f752802aeb2f778a000adadc88cbcd5801707d9..29c8147ac77c2203c67256a6ebda97f9501729b5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-02  Jan Hubicka  <jh@suse.cz>
+
+	* predict.c (predict_loops): Predict also exits not dominating
+	latch.
+
 2012-11-02  Jan Hubicka  <jh@suse.cz>
 
 	* predict.c (predict_loops): Do not predict infinite loops.
diff --git a/gcc/predict.c b/gcc/predict.c
index d27e04316ca8cfcd4dae1f67810aa9d3ef491b2c..8b9d62b286b8c1183d4ea33455dbd5cb23eba01e 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -1419,7 +1419,7 @@ predict_loops (void)
 
 	  predict_extra_loop_exits (ex);
 
-	  if (number_of_iterations_exit (loop, ex, &niter_desc, false))
+	  if (number_of_iterations_exit (loop, ex, &niter_desc, false, false))
 	    niter = niter_desc.niter;
 	  if (!niter || TREE_CODE (niter_desc.niter) != INTEGER_CST)
 	    niter = loop_niter_by_eval (loop, ex);