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
This commit is contained in:
Martin Liska 2016-06-23 13:04:35 +02:00 committed by Martin Liska
parent a34c0db51e
commit 60fa7862a0
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-06-23 Martin Liska <mliska@suse.cz>
PR middle-end/71619
* predict.c (predict_loops): Revert the hunk that was removed
in r237103.
2016-06-23 Jakub Sejdak <jakub.sejdak@phoesys.com>
* config.gcc: Add support for arm*-*-phoenix* targets.

View File

@ -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);
}

View File

@ -1,3 +1,7 @@
2016-06-23 Martin Liska <mliska@suse.cz>
* gcc.dg/pr71619.c: New test.
2016-06-23 H.J. Lu <hongjiu.lu@intel.com>
PR target/67400

View File

@ -0,0 +1,11 @@
/* PR 71619 */
/* { dg-do compile } */
/* { dg-options "-O --param=max-predicted-iterations=0" } */
void
foo ()
{
int count = -10;
while (count++);
}