From d2fa939e25a2da98e20ba604b0976690710f97f4 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Wed, 8 Jan 2014 13:40:21 -0500
Subject: [PATCH 102/159] FIXME: convert df_insn_info.insn to an rtx_base_insn

---
 gcc/cse.c          |  2 +-
 gcc/df-problems.c  |  2 +-
 gcc/df-scan.c      | 14 ++++++++------
 gcc/df.h           |  6 +++---
 gcc/emit-rtl.c     |  4 ++--
 gcc/fwprop.c       |  7 ++++---
 gcc/ira-emit.c     |  2 +-
 gcc/ira.c          |  2 +-
 gcc/lower-subreg.c |  8 ++++----
 gcc/rtlanal.c      |  2 +-
 10 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/gcc/cse.c b/gcc/cse.c
index e2167b8..7c3b4b3 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4300,7 +4300,7 @@ find_sets_in_insn (rtx insn, struct set **psets)
    see canon_reg.  */
 
 static void
-canonicalize_insn (rtx insn, struct set **psets, int n_sets)
+canonicalize_insn (rtx_base_insn insn, struct set **psets, int n_sets)
 {
   struct set *sets = *psets;
   rtx tem;
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index e86fcc3..cfb8b91 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -2885,7 +2885,7 @@ df_remove_dead_and_unused_notes (rtx insn)
    as the bitmap of currently live registers.  */
 
 static void
-df_remove_dead_eq_notes (rtx insn, bitmap live)
+df_remove_dead_eq_notes (rtx_base_insn insn, bitmap live)
 {
   rtx *pprev = &REG_NOTES (insn);
   rtx link = *pprev;
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 5119177..6c3ad3c 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -730,7 +730,7 @@ df_install_ref_incremental (df_ref ref)
   unsigned int count = 0;
   bool add_to_table;
 
-  rtx insn = DF_REF_INSN (ref);
+  rtx_base_insn insn = DF_REF_INSN (ref);
   basic_block bb = BLOCK_FOR_INSN (insn);
 
   if (DF_REF_REG_DEF_P (ref))
@@ -1021,7 +1021,7 @@ df_ref_remove (df_ref ref)
    out.  */
 
 struct df_insn_info *
-df_insn_create_insn_record (rtx insn)
+df_insn_create_insn_record (rtx_base_insn insn)
 {
   struct df_scan_problem_data *problem_data
     = (struct df_scan_problem_data *) df_scan->problem_data;
@@ -1261,7 +1261,8 @@ df_insn_rescan (rtx insn)
     {
       if (!insn_info)
 	{
-	  insn_info = df_insn_create_insn_record (insn);
+	  insn_info = df_insn_create_insn_record (
+			insn->as_an_rtx_base_insn ());
 	  insn_info->defs = df_null_ref_rec;
 	  insn_info->uses = df_null_ref_rec;
 	  insn_info->eq_uses = df_null_ref_rec;
@@ -1298,12 +1299,13 @@ df_insn_rescan (rtx insn)
 	 Since the insn isn't moved, we can salvage its LUID.  */
       luid = DF_INSN_LUID (insn);
       df_insn_info_delete (uid);
-      df_insn_create_insn_record (insn);
+      df_insn_create_insn_record (insn->as_an_rtx_base_insn ());
       DF_INSN_LUID (insn) = luid;
     }
   else
     {
-      struct df_insn_info *insn_info = df_insn_create_insn_record (insn);
+      struct df_insn_info *insn_info = df_insn_create_insn_record (
+					 insn->as_an_rtx_base_insn ());
       df_insn_refs_collect (&collection_rec, bb, insn_info);
       if (dump_file)
 	fprintf (dump_file, "scanning new insn with uid = %d.\n", uid);
@@ -2167,7 +2169,7 @@ df_mw_hardreg_chain_delete_eq_uses (struct df_insn_info *insn_info)
 /* Rescan only the REG_EQUIV/REG_EQUAL notes part of INSN.  */
 
 void
-df_notes_rescan (rtx insn)
+df_notes_rescan (rtx_base_insn insn)
 {
   struct df_insn_info *insn_info;
   unsigned int uid = INSN_UID (insn);
diff --git a/gcc/df.h b/gcc/df.h
index e3ca67b..d47fc66 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -419,7 +419,7 @@ typedef union df_ref_d *df_ref;
 /* One of these structures is allocated for every insn.  */
 struct df_insn_info
 {
-  rtx insn;                     /* The insn this info comes from.  */
+  rtx_base_insn insn;           /* The insn this info comes from.  */
   df_ref *defs;	                /* Head of insn-def chain.  */
   df_ref *uses;	                /* Head of insn-use chain.  */
   /* Head of insn-use chain for uses in REG_EQUAL/EQUIV notes.  */
@@ -996,7 +996,7 @@ extern df_ref df_ref_create (rtx, rtx *, rtx,basic_block,
 			     enum df_ref_type, int ref_flags);
 extern void df_uses_create (rtx *, rtx, int);
 extern void df_ref_remove (df_ref);
-extern struct df_insn_info * df_insn_create_insn_record (rtx);
+extern struct df_insn_info * df_insn_create_insn_record (rtx_base_insn);
 extern void df_insn_delete (rtx);
 extern void df_bb_refs_record (int, bool);
 extern bool df_insn_rescan (rtx);
@@ -1008,7 +1008,7 @@ extern void df_insn_change_bb (rtx, basic_block);
 extern void df_maybe_reorganize_use_refs (enum df_ref_order);
 extern void df_maybe_reorganize_def_refs (enum df_ref_order);
 extern void df_ref_change_reg_with_loc (int, int, rtx);
-extern void df_notes_rescan (rtx);
+extern void df_notes_rescan (rtx_base_insn);
 extern void df_hard_reg_init (void);
 extern void df_update_entry_block_defs (void);
 extern void df_update_exit_block_uses (void);
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 2d5a8d9..43b5733 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -5073,7 +5073,7 @@ set_unique_reg_note (rtx insn, enum reg_note kind, rtx datum)
       if (note)
 	{
 	  XEXP (note, 0) = datum;
-	  df_notes_rescan (insn);
+	  df_notes_rescan (insn->as_an_rtx_base_insn ());
 	  return note;
 	}
       break;
@@ -5093,7 +5093,7 @@ set_unique_reg_note (rtx insn, enum reg_note kind, rtx datum)
     {
     case REG_EQUAL:
     case REG_EQUIV:
-      df_notes_rescan (insn);
+      df_notes_rescan (insn->as_an_rtx_base_insn ());
       break;
     default:
       break;
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index 66afa83..cb1c473 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -921,7 +921,7 @@ update_uses (df_ref *use_rec)
    uses if NOTES_ONLY is true.  */
 
 static void
-update_df (rtx insn, rtx note)
+update_df (rtx_base_insn insn, rtx note)
 {
   struct df_insn_info *insn_info = DF_INSN_INFO_GET (insn);
 
@@ -950,7 +950,7 @@ update_df (rtx insn, rtx note)
 static bool
 try_fwprop_subst (df_ref use, rtx *loc, rtx new_rtx, rtx def_insn, bool set_reg_equal)
 {
-  rtx insn = DF_REF_INSN (use);
+  rtx_base_insn insn = DF_REF_INSN (use);
   rtx set = single_set (insn);
   rtx note = NULL_RTX;
   bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
@@ -1149,7 +1149,8 @@ forward_propagate_subreg (df_ref use, rtx def_insn, rtx def_set)
 static bool
 forward_propagate_asm (df_ref use, rtx def_insn, rtx def_set, rtx reg)
 {
-  rtx use_insn = DF_REF_INSN (use), src, use_pat, asm_operands, new_rtx, *loc;
+  rtx_base_insn use_insn = DF_REF_INSN (use);
+  rtx src, use_pat, asm_operands, new_rtx, *loc;
   int speed_p, i;
   df_ref *use_vec;
 
diff --git a/gcc/ira-emit.c b/gcc/ira-emit.c
index 1076582..8c2c60e 100644
--- a/gcc/ira-emit.c
+++ b/gcc/ira-emit.c
@@ -572,7 +572,7 @@ change_loop (ira_loop_tree_node_t node)
 	    if (INSN_P (insn) && change_regs (&insn))
 	      {
 		df_insn_rescan (insn);
-		df_notes_rescan (insn);
+		df_notes_rescan (insn->as_an_rtx_base_insn ());
 	      }
 	  return;
 	}
diff --git a/gcc/ira.c b/gcc/ira.c
index 8e28f5b..cbfe6b3 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -3762,7 +3762,7 @@ update_equiv_regs (void)
 		 the register.  */
 	      ira_reg_equiv[regno].init_insns
 		= gen_rtx_INSN_LIST (VOIDmode, insn, NULL_RTX);
-	      df_notes_rescan (init_insn);
+	      df_notes_rescan (init_insn->as_an_rtx_base_insn ());
 	    }
 	}
     }
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 502b022..d88a25d 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -800,7 +800,7 @@ adjust_decomposed_uses (rtx *px, void *data ATTRIBUTE_UNUSED)
    INSN.  */
 
 static void
-resolve_reg_notes (rtx insn)
+resolve_reg_notes (rtx_base_insn insn)
 {
   rtx *pnote, note;
 
@@ -1111,7 +1111,7 @@ resolve_simple_move (rtx set, rtx_base_insn insn)
    component registers.  Return whether we changed something.  */
 
 static bool
-resolve_clobber (rtx pat, rtx insn)
+resolve_clobber (rtx pat, rtx_base_insn insn)
 {
   rtx reg;
   enum machine_mode orig_mode;
@@ -1152,7 +1152,7 @@ resolve_clobber (rtx pat, rtx insn)
    whether we changed something.  */
 
 static bool
-resolve_use (rtx pat, rtx insn)
+resolve_use (rtx pat, rtx_base_insn insn)
 {
   if (resolve_reg_p (XEXP (pat, 0)) || resolve_subreg_p (XEXP (pat, 0)))
     {
@@ -1168,7 +1168,7 @@ resolve_use (rtx pat, rtx insn)
 /* A VAR_LOCATION can be simplified.  */
 
 static void
-resolve_debug (rtx insn)
+resolve_debug (rtx_base_insn insn)
 {
   for_each_rtx (&PATTERN (insn), adjust_decomposed_uses, NULL_RTX);
 
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 6b6bbc2..83d48c8 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2036,7 +2036,7 @@ remove_note (rtx insn, const_rtx note)
     {
     case REG_EQUAL:
     case REG_EQUIV:
-      df_notes_rescan (insn);
+      df_notes_rescan (insn->as_an_rtx_base_insn ());
       break;
     default:
       break;
-- 
1.7.11.7

