public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix typos in 2 functions.
@ 2019-12-09 15:08 Martin Liška
  2019-12-09 16:33 ` Jan Hubicka
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Liška @ 2019-12-09 15:08 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 625 bytes --]

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(-)



[-- Attachment #2: 0001-Fix-typos-in-2-functions.patch --]
[-- Type: text/x-patch, Size: 1422 bytes --]

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;
 }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix typos in 2 functions.
  2019-12-09 15:08 [PATCH] Fix typos in 2 functions Martin Liška
@ 2019-12-09 16:33 ` Jan Hubicka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Hubicka @ 2019-12-09 16:33 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-12-09 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-09 15:08 [PATCH] Fix typos in 2 functions Martin Liška
2019-12-09 16:33 ` Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).