public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-5769] loop-iv: Add missing calls to `onlyjump_p'
@ 2020-12-05 18:28 Maciej W. Rozycki
  0 siblings, 0 replies; only message in thread
From: Maciej W. Rozycki @ 2020-12-05 18:28 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a2bd4e52cf710924107b08daaf3d09d7798c8022

commit r11-5769-ga2bd4e52cf710924107b08daaf3d09d7798c8022
Author: Maciej W. Rozycki <macro@linux-mips.org>
Date:   Sat Dec 5 18:26:24 2020 +0000

    loop-iv: Add missing calls to `onlyjump_p'
    
    Ignore jumps that have side effects in loop processing as pasting the
    body of a loop multiple times within is semantically equivalent to jump
    deletion (between the iterations unrolled) even if we do not physically
    delete the jump RTL insn.
    
            gcc/
            * loop-iv.c (simplify_using_initial_values): Only process jumps
            that match `onlyjump_p'.
            (check_simple_exit): Likewise.

Diff:
---
 gcc/loop-iv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 9f266e2a43c..9d401d29b95 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -1936,7 +1936,7 @@ simplify_using_initial_values (class loop *loop, enum rtx_code op, rtx *expr)
   while (1)
     {
       insn = BB_END (e->src);
-      if (any_condjump_p (insn))
+      if (any_condjump_p (insn) && onlyjump_p (insn))
 	{
 	  rtx cond = get_condition (BB_END (e->src), NULL, false, true);
 
@@ -2887,7 +2887,7 @@ check_simple_exit (class loop *loop, edge e, class niter_desc *desc)
     return;
 
   /* It must end in a simple conditional jump.  */
-  if (!any_condjump_p (BB_END (exit_bb)))
+  if (!any_condjump_p (BB_END (exit_bb)) || !onlyjump_p (BB_END (exit_bb)))
     return;
 
   ein = EDGE_SUCC (exit_bb, 0);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-05 18:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-05 18:28 [gcc r11-5769] loop-iv: Add missing calls to `onlyjump_p' Maciej W. Rozycki

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