public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/pheeck/heads/sccp)] sccp handling was_noreturn and can_make_abnormal_goto
@ 2023-03-02 12:13 Filip Kastl
  0 siblings, 0 replies; only message in thread
From: Filip Kastl @ 2023-03-02 12:13 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:72b7332883ae3380f0e18280a89fa55ef00d0b2d

commit 72b7332883ae3380f0e18280a89fa55ef00d0b2d
Author: Filip Kastl <filip.kastl@gmail.com>
Date:   Tue Feb 28 13:00:14 2023 +0100

    sccp handling was_noreturn and can_make_abnormal_goto

Diff:
---
 gcc/sccp.cc               | 11 +++++++++--
 gcc/tree-ssa-propagate.cc |  3 ++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/gcc/sccp.cc b/gcc/sccp.cc
index 6c8791d8724..57c821a4f9c 100644
--- a/gcc/sccp.cc
+++ b/gcc/sccp.cc
@@ -455,6 +455,14 @@ replace_use_by (tree get_replaced, tree replace_by, bitmap need_eh_cleanup,
   gimple *use_stmt;
   FOR_EACH_IMM_USE_STMT (use_stmt, iter, get_replaced)
     {
+      bool was_noreturn = false;
+      bool can_make_abnormal_goto = false;
+      if (is_gimple_call (use_stmt))
+	{
+	  was_noreturn = gimple_call_noreturn_p (use_stmt);
+	  can_make_abnormal_goto = stmt_can_make_abnormal_goto (use_stmt);
+	}
+
       FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
 	SET_USE (use_p, unshare_expr (replace_by));
 
@@ -472,8 +480,7 @@ replace_use_by (tree get_replaced, tree replace_by, bitmap need_eh_cleanup,
       fold_stmt (&gsi);
       cleanup_after_replace (use_stmt, gsi_stmt (gsi), need_eh_cleanup,
 			     need_ab_cleanup, stmts_to_fixup,
-			     false, false);
-      update_stmt (gsi_stmt (gsi));
+			     can_make_abnormal_goto, was_noreturn);
     }
 }
 
diff --git a/gcc/tree-ssa-propagate.cc b/gcc/tree-ssa-propagate.cc
index e0eeae70ece..01e125bb873 100644
--- a/gcc/tree-ssa-propagate.cc
+++ b/gcc/tree-ssa-propagate.cc
@@ -909,7 +909,6 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb)
 				 can_make_abnormal_goto, was_noreturn);
 
 	  /* Determine what needs to be done to update the SSA form.  */
-	  update_stmt_if_modified (stmt);
 	  if (!is_gimple_debug (stmt))
 	    something_changed = true;
 	}
@@ -1316,6 +1315,8 @@ cleanup_after_replace (gimple *old_stmt, gimple *stmt, bitmap need_eh_cleanup,
       if (TREE_CODE (rhs) == ADDR_EXPR)
 	recompute_tree_invariant_for_addr_expr (rhs);
     }
+
+  update_stmt_if_modified (stmt);
 }
 
 /* TODO Comment.  */

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

only message in thread, other threads:[~2023-03-02 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-02 12:13 [gcc(refs/users/pheeck/heads/sccp)] sccp handling was_noreturn and can_make_abnormal_goto Filip Kastl

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