re PR tree-optimization/86038 (ICE in to_reg_br_prob_base, at profile-count.h:242)
authorRichard Biener <rguenther@suse.de>
Mon, 4 Jun 2018 09:28:22 +0000 (09:28 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 4 Jun 2018 09:28:22 +0000 (09:28 +0000)
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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr86038.c [new file with mode: 0644]
gcc/tracer.c

index e780766..fde65eb 100644 (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
index f889ebb..6ec5c50 100644 (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
diff --git a/gcc/testsuite/gcc.dg/pr86038.c b/gcc/testsuite/gcc.dg/pr86038.c
new file mode 100644 (file)
index 0000000..427a13f
--- /dev/null
@@ -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;
+}
index 6181513..05300a2 100644 (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;
 }