diff mbox

[gimple-classes,committed,77/92] Concretize gimple_call_nothrow_p

Message ID 1414442490-14841-78-git-send-email-dmalcolm@redhat.com
State New
Headers show

Commit Message

David Malcolm Oct. 27, 2014, 8:41 p.m. UTC
This corresponds to:
  [PATCH 79/89] Concretize gimple_call_nothrow_p
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01204.html
from the original 89-patch kit

That earlier patch was approved by Jeff:
> OK once prerequisites have gone in.
in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00844.html

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/ChangeLog.gimple-classes | 11 +++++++++++
 gcc/gimple.h                 |  3 +--
 gcc/tree-eh.c                |  2 +-
 gcc/tree-vect-slp.c          | 15 ++++++++-------
 4 files changed, 21 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 21e051b..503fff5 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,16 @@ 
 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
 
+	Concretize gimple_call_nothrow_p
+
+	* 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.
+
+2014-10-24  David Malcolm  <dmalcolm@redhat.com>
+
 	Concretize gimple_call_set_nothrow
 
 	* gimple.h (gimple_call_set_nothrow): Require a gimple_call.
diff --git a/gcc/gimple.h b/gcc/gimple.h
index e220228..ac6d664 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -2923,9 +2923,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 2ef68c9..cd84756 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -2792,7 +2792,7 @@  stmt_could_throw_p (gimple stmt)
       return true;
 
     case GIMPLE_CALL:
-      return !gimple_call_nothrow_p (stmt);
+      return !gimple_call_nothrow_p (as_a <gimple_call> (stmt));
 
     case GIMPLE_ASSIGN:
     case GIMPLE_COND:
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 5984229..8541de8 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 = dyn_cast <gimple_call> (stmt))
 	{
 	  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.  */