Fix typos in 2 functions.
diff mbox series

Message ID c001d78c-5f5e-25ac-f908-65248094ea08@suse.cz
State New
Headers show
Series
  • Fix typos in 2 functions.
Related show

Commit Message

Martin Liška Dec. 9, 2019, 3:08 p.m. UTC
Hi.

I'm sending fix for 2 locations where we have a typo.
Second hunk is pre-approved by Rich, first one needs to be approved
by Honza?

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Ready to be installed?
Thanks,
Martin

gcc/ChangeLog:

2019-12-09  Martin Liska  <mliska@suse.cz>

	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;
---
  gcc/predict.c             |  7 +++----
  gcc/tree-ssa-loop-niter.c | 10 +++-------
  2 files changed, 6 insertions(+), 11 deletions(-)

Comments

Jan Hubicka Dec. 9, 2019, 4:33 p.m. UTC | #1
> Hi.
> 
> I'm sending fix for 2 locations where we have a typo.
> Second hunk is pre-approved by Rich, first one needs to be approved
> by Honza?
> 
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> 
> Ready to be installed?
> Thanks,
> Martin
> 
> gcc/ChangeLog:
> 
> 2019-12-09  Martin Liska  <mliska@suse.cz>
> 
> 	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;

OK, thanks!

Honza

Patch
diff mbox series

diff --git a/gcc/predict.c b/gcc/predict.c
index 67f850de17a..8db24816d29 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 f0dd9a0b363..39e937705f1 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;
 }