From 4741e46d775429fe32086dd93ced7ea86644eba2 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 4 Jul 2017 15:41:21 +0200 Subject: [PATCH] bb-reorder.c (better_edge_p): Fix handling of uninitialized probability. * bb-reorder.c (better_edge_p): Fix handling of uninitialized probability. From-SVN: r249966 --- gcc/ChangeLog | 5 +++++ gcc/bb-reorder.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 27df4b86c0c..5a1659d01c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-07-04 Jan Hubicka + + * bb-reorder.c (better_edge_p): Fix handling of uninitialized + probability. + 2017-07-04 Richard Sandiford PR tree-optimization/81292 diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index ebd8b481a92..1994c1f7a5f 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -957,7 +957,7 @@ better_edge_p (const_basic_block bb, const_edge e, profile_probability prob, return !cur_best_edge || cur_best_edge->dest->index > e->dest->index; - if (prob > best_prob + diff_prob) + if (prob > best_prob + diff_prob || !best_prob.initialized_p ()) /* The edge has higher probability than the temporary best edge. */ is_better_edge = true; else if (prob < best_prob - diff_prob) -- 2.30.2