From 60fa7862a0a1ad80f587cb29bcc8613a78303f90 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 23 Jun 2016 13:04:35 +0200 Subject: re PR middle-end/71619 (ICE: in predict_loops, at predict.c:1772 with --param=max-predicted-iterations=0) Fix PR middle-end/71619 PR middle-end/71619 * predict.c (predict_loops): Revert the hunk that was removed in r237103. * gcc.dg/pr71619.c: New test. From-SVN: r237730 --- gcc/predict.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/predict.c') diff --git a/gcc/predict.c b/gcc/predict.c index 470de8a..d505d9c 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -1769,7 +1769,11 @@ predict_loops (void) else continue; - gcc_checking_assert (nitercst); + /* If the prediction for number of iterations is zero, do not + predict the exit edges. */ + if (nitercst == 0) + continue; + probability = RDIV (REG_BR_PROB_BASE, nitercst); predict_edge (ex, predictor, probability); } -- cgit v1.1