From c77bb6744644149d5a64b909db98671f57d92f83 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 4 Jun 2018 09:28:22 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr86038.c | 12 ++++++++++++ gcc/tracer.c | 3 ++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr86038.c 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; } -- 2.30.2