From: Richard Biener Date: Mon, 4 Jun 2018 09:28:22 +0000 (+0000) Subject: re PR tree-optimization/86038 (ICE in to_reg_br_prob_base, at profile-count.h:242) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c77bb6744644149d5a64b909db98671f57d92f83;p=gcc.git re PR tree-optimization/86038 (ICE in to_reg_br_prob_base, at profile-count.h:242) 2018-06-04 Richard Biener 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e780766e7d8..fde65ebae1d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-06-04 Richard Biener + + PR tree-optimization/86038 + * tracer.c (find_best_successor): Check probability for + being initialized, bail out if not. + 2018-06-04 Richard Earnshaw PR target/86003 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f889ebb5cde..6ec5c50b9e5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-06-04 Richard Biener + + PR tree-optimization/86038 + * gcc.dg/pr86038.c: New testcase. + 2018-06-04 Jakub Jelinek PR tree-optimization/69615 diff --git a/gcc/testsuite/gcc.dg/pr86038.c b/gcc/testsuite/gcc.dg/pr86038.c new file mode 100644 index 00000000000..427a13f18c3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr86038.c @@ -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; +} diff --git a/gcc/tracer.c b/gcc/tracer.c index 61815130802..05300a289ea 100644 --- a/gcc/tracer.c +++ b/gcc/tracer.c @@ -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; }