re PR tree-optimization/86038 (ICE in to_reg_br_prob_base, at profile-count.h:242)

2018-06-04  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/86038
	* tracer.c (find_best_successor): Check probability for
	being initialized, bail out if not.

	* gcc.dg/pr86038.c: New testcase.

From-SVN: r261142
This commit is contained in:
Richard Biener 2018-06-04 09:28:22 +00:00 committed by Richard Biener
parent 34a1d5c2c7
commit c77bb67446
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2018-06-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/86038
* tracer.c (find_best_successor): Check probability for
being initialized, bail out if not.
2018-06-04 Richard Earnshaw <rearnsha@arm.com>
PR target/86003

View File

@ -1,3 +1,8 @@
2018-06-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/86038
* gcc.dg/pr86038.c: New testcase.
2018-06-04 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/69615

View File

@ -0,0 +1,12 @@
/* { dg-do compile } */
/* { dg-require-effective-target pthread } */
/* { dg-options "-O2 -ftracer -ftree-parallelize-loops=2 -fno-tree-scev-cprop --param parloops-schedule=dynamic" } */
int
sd (int lw)
{
while (lw < 1)
++lw;
return lw;
}

View File

@ -159,7 +159,8 @@ find_best_successor (basic_block bb)
}
if (!best || ignore_bb_p (best->dest))
return NULL;
if (best->probability.to_reg_br_prob_base () <= probability_cutoff)
if (!best->probability.initialized_p ()
|| best->probability.to_reg_br_prob_base () <= probability_cutoff)
return NULL;
return best;
}