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]

[gimple-classes, committed 57/92] Make gimple_goto_set_dest require a gimple_goto


This corresponds to:
  [PATCH 59/89] Make gimple_goto_set_dest require a gimple_goto
  https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01193.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/msg00815.html

gcc/
	* gimple.h (gimple_goto_set_dest): Require a gimple_goto.

	* tree-cfg.c (factor_computed_gotos): Add checked cast to
	gimple_goto.
	(cleanup_dead_labels): Likewise.
---
 gcc/ChangeLog.gimple-classes | 10 ++++++++++
 gcc/gimple.h                 |  3 +--
 gcc/tree-cfg.c               |  5 +++--
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes
index 2e1ea10..dd735af 100644
--- a/gcc/ChangeLog.gimple-classes
+++ b/gcc/ChangeLog.gimple-classes
@@ -1,5 +1,15 @@
 2014-10-24  David Malcolm  <dmalcolm@redhat.com>
 
+	Make gimple_goto_set_dest require a gimple_goto
+
+	* gimple.h (gimple_goto_set_dest): Require a gimple_goto.
+
+	* tree-cfg.c (factor_computed_gotos): Add checked cast to
+	gimple_goto.
+	(cleanup_dead_labels): Likewise.
+
+2014-10-24  David Malcolm  <dmalcolm@redhat.com>
+
 	Make gimple_label_set_label require a gimple_label
 
 	* gimple.h (gimple_label_set_label): Require a gimple_label.
diff --git a/gcc/gimple.h b/gcc/gimple.h
index e195dd4..fc80407 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -3237,9 +3237,8 @@ gimple_goto_dest (const_gimple gs)
 /* Set DEST to be the destination of the unconditonal jump GS.  */
 
 static inline void
-gimple_goto_set_dest (gimple gs, tree dest)
+gimple_goto_set_dest (gimple_goto gs, tree dest)
 {
-  GIMPLE_CHECK (gs, GIMPLE_GOTO);
   gimple_set_op (gs, 0, dest);
 }
 
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 697a3f1..be4c00e 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -1466,10 +1466,11 @@ cleanup_dead_labels (void)
 	case GIMPLE_GOTO:
 	  if (!computed_goto_p (stmt))
 	    {
-	      label = gimple_goto_dest (stmt);
+	      gimple_goto goto_stmt = as_a <gimple_goto> (stmt);
+	      label = gimple_goto_dest (goto_stmt);
 	      new_label = main_block_label (label);
 	      if (new_label != label)
-		gimple_goto_set_dest (stmt, new_label);
+		gimple_goto_set_dest (goto_stmt, new_label);
 	    }
 	  break;
 
-- 
1.8.5.3


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