diff mbox

[gimple-classes,committed,11/44] gimple-ssa-isolate-paths.c: Use gassign

Message ID 1415284340-14186-12-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Nov. 6, 2014, 2:31 p.m. UTC
gcc/ChangeLog.gimple-classes:
	* gimple-ssa-isolate-paths.c
	(insert_trap_and_remove_trailing_statements): Replace a call to
	is_gimple_assign with a dyn_cast, introducing a local
	"assign_stmt", and using it in place of "stmt" for typesafety.
---
 gcc/ChangeLog.gimple-classes   |  7 +++++++
 gcc/gimple-ssa-isolate-paths.c | 12 +++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 33911d3..dc1315e 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,12 @@ 
 2014-11-03  David Malcolm  <dmalcolm@redhat.com>
 
+	* gimple-ssa-isolate-paths.c
+	(insert_trap_and_remove_trailing_statements): Replace a call to
+	is_gimple_assign with a dyn_cast, introducing a local
+	"assign_stmt", and using it in place of "stmt" for typesafety.
+
+2014-11-03  David Malcolm  <dmalcolm@redhat.com>
+
 	* gimplify-me.c (gimple_regimplify_operands): Replace a couple of
 	is_gimple_assign calls with dyn_cast, introducing locals
 	"assign_stmt" and using them in place of "stmt" for typesafety.
diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c
index ea8ead0..885f392 100644
--- a/gcc/gimple-ssa-isolate-paths.c
+++ b/gcc/gimple-ssa-isolate-paths.c
@@ -95,15 +95,17 @@  insert_trap_and_remove_trailing_statements (gimple_stmt_iterator *si_p, tree op)
      then simplify the RHS to enable more DCE.   Note that we require the
      statement to be a GIMPLE_ASSIGN which filters out calls on the RHS.  */
   gimple stmt = gsi_stmt (*si_p);
+  gassign *assign_stmt;
   if (walk_stmt_load_store_ops (stmt, (void *)op, NULL, check_loadstore)
-      && is_gimple_assign (stmt)
-      && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (stmt))))
+      && (assign_stmt = dyn_cast <gassign *> (stmt))
+      && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (assign_stmt))))
     {
       /* We just need to turn the RHS into zero converted to the proper
          type.  */
-      tree type = TREE_TYPE (gimple_assign_lhs (stmt));
-      gimple_assign_set_rhs_code (stmt, INTEGER_CST);
-      gimple_assign_set_rhs1 (stmt, fold_convert (type, integer_zero_node));
+      tree type = TREE_TYPE (gimple_assign_lhs (assign_stmt));
+      gimple_assign_set_rhs_code (assign_stmt, INTEGER_CST);
+      gimple_assign_set_rhs1 (assign_stmt,
+			      fold_convert (type, integer_zero_node));
       update_stmt (stmt);
     }