This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 79/89] Concretize gimple_call_nothrow_p


gcc/
	* gimple.h (gimple_call_nothrow_p): Require a gimple_call.

	* tree-eh.c (stmt_could_throw_p): Add checked cast to gimple_call.

	* tree-vect-slp.c (vect_build_slp_tree_1): Replace call to
	is_gimple_call with dyn_cast_gimple_call, introducing a local.
---
 gcc/gimple.h        |  3 +--
 gcc/tree-eh.c       |  2 +-
 gcc/tree-vect-slp.c | 15 ++++++++-------
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/gcc/gimple.h b/gcc/gimple.h
index f3242c4..33f1889 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -3201,9 +3201,8 @@ gimple_call_set_nothrow (gimple_call s, bool nothrow_p)
 /* Return true if S is a nothrow call.  */
 
 static inline bool
-gimple_call_nothrow_p (gimple s)
+gimple_call_nothrow_p (gimple_call s)
 {
-  GIMPLE_CHECK (s, GIMPLE_CALL);
   return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
 }
 
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 46dcc20..5e4eef8 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -2820,7 +2820,7 @@ stmt_could_throw_p (gimple stmt)
       return true;
 
     case GIMPLE_CALL:
-      return !gimple_call_nothrow_p (stmt);
+      return !gimple_call_nothrow_p (stmt->as_a_gimple_call ());
 
     case GIMPLE_ASSIGN:
     case GIMPLE_COND:
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 65f8b02..31d4dfb 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -505,20 +505,21 @@ vect_build_slp_tree_1 (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo,
             vectorization_factor = *max_nunits;
         }
 
-      if (is_gimple_call (stmt))
+      if (gimple_call call_stmt = stmt->dyn_cast_gimple_call ())
 	{
 	  rhs_code = CALL_EXPR;
-	  if (gimple_call_internal_p (stmt)
-	      || gimple_call_tail_p (stmt)
-	      || gimple_call_noreturn_p (stmt)
-	      || !gimple_call_nothrow_p (stmt)
-	      || gimple_call_chain (stmt))
+	  if (gimple_call_internal_p (call_stmt)
+	      || gimple_call_tail_p (call_stmt)
+	      || gimple_call_noreturn_p (call_stmt)
+	      || !gimple_call_nothrow_p (call_stmt)
+	      || gimple_call_chain (call_stmt))
 	    {
 	      if (dump_enabled_p ())
 		{
 		  dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, 
 				   "Build SLP failed: unsupported call type ");
-		  dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM, stmt, 0);
+		  dump_gimple_stmt (MSG_MISSED_OPTIMIZATION, TDF_SLIM,
+				    call_stmt, 0);
                   dump_printf (MSG_MISSED_OPTIMIZATION, "\n");
 		}
 	      /* Fatal mismatch.  */
-- 
1.8.5.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]