From e56c3bcfb5415484b321c8c58478563bec8214ad Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Thu, 9 Jan 2014 12:56:58 -0500
Subject: [PATCH 118/159] FIXME: convert edge_def_insns.r to be rtx_base_insn

---
 gcc/basic-block.h     |  2 +-
 gcc/cfgexpand.c       |  6 +++---
 gcc/cfgrtl.c          |  2 +-
 gcc/cprop.c           |  2 +-
 gcc/postreload-gcse.c |  4 ++--
 gcc/tree-cfg.c        | 14 ++++++++++++++
 gcc/tree-outof-ssa.c  |  4 ++--
 7 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index d9a0651..c45269e 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -39,7 +39,7 @@ struct GTY((user)) edge_def {
   /* Instructions queued on the edge.  */
   union edge_def_insns {
     gimple_seq g;
-    rtx r;
+    rtx_base_insn r;
   } insns;
 
   /* Auxiliary info specific to a pass.  */
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 3d9edd8..32b2d48 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -5768,14 +5768,14 @@ gimple_expand_cfg (void)
 	{
 	  if (e->insns.r)
 	    {
-	      rebuild_jump_labels_chain (e->insns.r->as_an_rtx_base_insn ());
+	      rebuild_jump_labels_chain (e->insns.r);
 	      /* Put insns after parm birth, but before
 		 NOTE_INSNS_FUNCTION_BEG.  */
 	      if (e->src == ENTRY_BLOCK_PTR_FOR_FN (cfun)
 		  && single_succ_p (ENTRY_BLOCK_PTR_FOR_FN (cfun)))
 		{
-		  rtx insns = e->insns.r;
-		  e->insns.r = NULL_RTX;
+		  rtx_base_insn insns = e->insns.r;
+		  e->insns.r = NULL_RTX_BASE_INSN;
 		  if (NOTE_P (parm_birth_insn)
 		      && NOTE_KIND (parm_birth_insn) == NOTE_INSN_FUNCTION_BEG)
 		    emit_insn_before_noloc (insns, parm_birth_insn, e->dest);
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 0dbae46..991401b 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -1959,7 +1959,7 @@ commit_one_edge_insertion (edge e)
 
   /* Pull the insns off the edge now since the edge might go away.  */
   insns = e->insns.r;
-  e->insns.r = NULL_RTX;
+  e->insns.r = NULL_RTX_BASE_INSN;
 
   /* Figure out where to put these insns.  If the destination has
      one predecessor, insert there.  Except for the exit block.  */
diff --git a/gcc/cprop.c b/gcc/cprop.c
index 75f0253..4f6facf 100644
--- a/gcc/cprop.c
+++ b/gcc/cprop.c
@@ -1472,7 +1472,7 @@ find_bypass_set (int regno, int bb)
 static bool
 reg_killed_on_edge (const_rtx reg, const_edge e)
 {
-  rtx insn;
+  rtx_base_insn insn;
 
   for (insn = e->insns.r; insn; insn = NEXT_INSN (insn))
     if (INSN_P (insn) && reg_set_p (reg, insn))
diff --git a/gcc/postreload-gcse.c b/gcc/postreload-gcse.c
index 65b8bc4..f431867 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -859,7 +859,7 @@ compute_hash_table (void)
 static bool
 reg_killed_on_edge (rtx reg, edge e)
 {
-  rtx insn;
+  rtx_base_insn insn;
 
   for (insn = e->insns.r; insn; insn = NEXT_INSN (insn))
     if (INSN_P (insn) && reg_set_p (reg, insn))
@@ -876,7 +876,7 @@ reg_killed_on_edge (rtx reg, edge e)
 static bool
 reg_used_on_edge (rtx reg, edge e)
 {
-  rtx insn;
+  rtx_base_insn insn;
 
   for (insn = e->insns.r; insn; insn = NEXT_INSN (insn))
     if (INSN_P (insn) && reg_overlap_mentioned_p (reg, PATTERN (insn)))
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 6d1ebe6..200b80f 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -8444,6 +8444,13 @@ extern void gt_ggc_mx (gimple&);
 extern void gt_ggc_mx (rtx&);
 extern void gt_ggc_mx (basic_block&);
 
+static void
+gt_ggc_mx (rtx_base_insn& x)
+{
+  if (x)
+    gt_ggc_mx_rtx_def ((void *) x);
+}
+
 void
 gt_ggc_mx (edge_def *e)
 {
@@ -8464,6 +8471,13 @@ extern void gt_pch_nx (gimple&);
 extern void gt_pch_nx (rtx&);
 extern void gt_pch_nx (basic_block&);
 
+static void
+gt_pch_nx (rtx_base_insn& x)
+{
+  if (x)
+    gt_pch_nx_rtx_def ((void *) x);
+}
+
 void
 gt_pch_nx (edge_def *e)
 {
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 8df3026..9aea52a 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -958,9 +958,9 @@ expand_phi_nodes (struct ssaexpand *sa)
 	    if (e->insns.r && (e->flags & EDGE_EH)
 		&& !single_pred_p (e->dest))
 	      {
-		rtx insns = e->insns.r;
+		rtx_base_insn insns = e->insns.r;
 		basic_block bb;
-		e->insns.r = NULL_RTX;
+		e->insns.r = NULL_RTX_BASE_INSN;
 		bb = split_edge (e);
 		single_pred_edge (bb)->insns.r = insns;
 	      }
-- 
1.7.11.7

