From 52dc9c32311e8ea4833b8865c0d3121cad03937d Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 10 Dec 2019 09:36:56 +0100 Subject: [PATCH] Fix typos in 2 functions. 2019-12-10 Martin Liska PR tree-optimization/92862 * predict.c (predict_paths_leading_to_edge): Fix typo from e to e2. * tree-ssa-loop-niter.c (loop_only_exit_p): Return false instead of true; From-SVN: r279156 --- gcc/ChangeLog | 7 +++++++ gcc/predict.c | 7 +++---- gcc/tree-ssa-loop-niter.c | 10 +++------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 42ae999..9e53a32 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-12-10 Martin Liska + + PR tree-optimization/92862 + * predict.c (predict_paths_leading_to_edge): Fix typo from e to e2. + * tree-ssa-loop-niter.c (loop_only_exit_p): Return false + instead of true; + 2019-12-09 David Malcolm * gcc-rich-location.c diff --git a/gcc/predict.c b/gcc/predict.c index 67f850d..8db2481 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -3217,16 +3217,15 @@ predict_paths_leading_to_edge (edge e, enum br_predictor pred, basic_block bb = e->src; FOR_EACH_EDGE (e2, ei, bb->succs) if (e2->dest != e->src && e2->dest != e->dest - && !unlikely_executed_edge_p (e) + && !unlikely_executed_edge_p (e2) && !dominated_by_p (CDI_POST_DOMINATORS, e->src, e2->dest)) { has_nonloop_edge = true; break; } + if (!has_nonloop_edge) - { - predict_paths_for_bb (bb, bb, pred, taken, auto_bitmap (), in_loop); - } + predict_paths_for_bb (bb, bb, pred, taken, auto_bitmap (), in_loop); else predict_edge_def (e, pred, taken); } diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index f0dd9a0..39e9377 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2376,13 +2376,9 @@ loop_only_exit_p (const class loop *loop, basic_block *body, const_edge exit) return false; for (i = 0; i < loop->num_nodes; i++) - { - for (bsi = gsi_start_bb (body[i]); !gsi_end_p (bsi); gsi_next (&bsi)) - if (stmt_can_terminate_bb_p (gsi_stmt (bsi))) - { - return true; - } - } + for (bsi = gsi_start_bb (body[i]); !gsi_end_p (bsi); gsi_next (&bsi)) + if (stmt_can_terminate_bb_p (gsi_stmt (bsi))) + return false; return true; } -- 2.7.4