diff options
author | Martin Liska <mliska@suse.cz> | 2016-06-23 13:04:35 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2016-06-23 11:04:35 +0000 |
commit | 60fa7862a0a1ad80f587cb29bcc8613a78303f90 (patch) | |
tree | df16bfb9e6381769574b4fdd31b09baa90fe3fcf /gcc/predict.c | |
parent | a34c0db51e718fc4d6a50cb5f2e20154a032158d (diff) | |
download | gcc-60fa7862a0a1ad80f587cb29bcc8613a78303f90.zip gcc-60fa7862a0a1ad80f587cb29bcc8613a78303f90.tar.gz gcc-60fa7862a0a1ad80f587cb29bcc8613a78303f90.tar.bz2 |
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
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 6 |
1 files changed, 5 insertions, 1 deletions
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); } |