From 0cf17a254f5fe53304d952b422949d02c3ab4bee Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 31 Dec 2013 15:51:56 -0500
Subject: [PATCH 054/159] FIXME: reload

---
 gcc/reload.h  |  2 +-
 gcc/reload1.c | 37 +++++++++++++++++++------------------
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/gcc/reload.h b/gcc/reload.h
index 05626a5..9a7a1a0 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -413,7 +413,7 @@ extern int push_reload (rtx, rtx, rtx *, rtx *, enum reg_class,
 extern void init_reload (void);
 
 /* The reload pass itself.  */
-extern bool reload (rtx, int);
+extern bool reload (rtx_base_insn, int);
 
 /* Mark the slots in regs_ever_live for the hard regs
    used by pseudo-reg number REGNO.  */
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 437433b..2b24f55 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -354,22 +354,22 @@ static void find_reload_regs (struct insn_chain *);
 static void select_reload_regs (void);
 static void delete_caller_save_insns (void);
 
-static void spill_failure (rtx, enum reg_class);
+static void spill_failure (rtx_base_insn, enum reg_class);
 static void count_spilled_pseudo (int, int, int);
-static void delete_dead_insn (rtx);
+static void delete_dead_insn (rtx_base_insn);
 static void alter_reg (int, int, bool);
-static void set_label_offsets (rtx, rtx, int);
+static void set_label_offsets (rtx, rtx_base_insn, int);
 static void check_eliminable_occurrences (rtx);
 static void elimination_effects (rtx, enum machine_mode);
 static rtx eliminate_regs_1 (rtx, enum machine_mode, rtx, bool, bool);
-static int eliminate_regs_in_insn (rtx, int);
+static int eliminate_regs_in_insn (rtx_base_insn, int);
 static void update_eliminable_offsets (void);
 static void mark_not_eliminable (rtx, const_rtx, void *);
 static void set_initial_elim_offsets (void);
 static bool verify_initial_elim_offsets (void);
 static void set_initial_label_offsets (void);
 static void set_offsets_for_label (rtx);
-static void init_eliminable_invariants (rtx, bool);
+static void init_eliminable_invariants (rtx_base_insn, bool);
 static void init_elim_table (void);
 static void free_reg_equiv (void);
 static void update_eliminables (HARD_REG_SET *);
@@ -701,7 +701,7 @@ static int *temp_pseudo_reg_arr;
    return value is FALSE.  */
 
 bool
-reload (rtx first, int global)
+reload (rtx_base_insn first, int global)
 {
   int i, n;
   rtx insn;
@@ -1007,7 +1007,8 @@ reload (rtx first, int global)
 	  rtx list;
 	  for (list = reg_equiv_init (i); list; list = XEXP (list, 1))
 	    {
-	      rtx equiv_insn = XEXP (list, 0);
+	      rtx_base_insn equiv_insn =
+		XEXP (list, 0)->as_an_rtx_base_insn ();
 
 	      /* If we already deleted the insn or if it may trap, we can't
 		 delete it.  The latter case shouldn't happen, but can
@@ -2064,7 +2065,7 @@ delete_caller_save_insns (void)
       while (c != 0 && c->is_caller_save_insn)
 	{
 	  struct insn_chain *next = c->next;
-	  rtx insn = c->insn;
+	  rtx_base_insn insn = c->insn;
 
 	  if (c == reload_insn_chain)
 	    reload_insn_chain = next;
@@ -2087,7 +2088,7 @@ delete_caller_save_insns (void)
    INSN should be one of the insns which needed this particular spill reg.  */
 
 static void
-spill_failure (rtx insn, enum reg_class rclass)
+spill_failure (rtx_base_insn insn, enum reg_class rclass)
 {
   if (asm_noperands (PATTERN (insn)) >= 0)
     error_for_asm (insn, "can%'t find a register in class %qs while "
@@ -2111,9 +2112,9 @@ spill_failure (rtx insn, enum reg_class rclass)
    data that is dead in INSN.  */
 
 static void
-delete_dead_insn (rtx insn)
+delete_dead_insn (rtx_base_insn insn)
 {
-  rtx prev = prev_active_insn (insn);
+  rtx_base_insn prev = prev_active_insn (insn);
   rtx prev_dest;
 
   /* If the previous insn sets a register that dies in our insn make
@@ -2333,7 +2334,7 @@ mark_home_live (int regno)
    current offset.  */
 
 static void
-set_label_offsets (rtx x, rtx insn, int initial_p)
+set_label_offsets (rtx x, rtx_base_insn insn, int initial_p)
 {
   enum rtx_code code = GET_CODE (x);
   rtx tem;
@@ -3207,7 +3208,7 @@ check_eliminable_occurrences (rtx x)
    is returned.  Otherwise, 1 is returned.  */
 
 static int
-eliminate_regs_in_insn (rtx insn, int replace)
+eliminate_regs_in_insn (rtx_base_insn insn, int replace)
 {
   int icode = recog_memoized (insn);
   rtx old_body = PATTERN (insn);
@@ -3884,7 +3885,7 @@ set_initial_elim_offsets (void)
 static void
 set_initial_eh_label_offset (rtx label)
 {
-  set_label_offsets (label, NULL_RTX, 1);
+  set_label_offsets (label, NULL_RTX_BASE_INSN, 1);
 }
 
 /* Initialize the known label offsets.
@@ -3902,11 +3903,11 @@ set_initial_label_offsets (void)
 
   for (x = forced_labels; x; x = XEXP (x, 1))
     if (XEXP (x, 0))
-      set_label_offsets (XEXP (x, 0), NULL_RTX, 1);
+      set_label_offsets (XEXP (x, 0), NULL_RTX_BASE_INSN, 1);
 
   for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
     if (XEXP (x, 0))
-      set_label_offsets (XEXP (x, 0), NULL_RTX, 1);
+      set_label_offsets (XEXP (x, 0), NULL_RTX_BASE_INSN, 1);
 
   for_each_eh_label (set_initial_eh_label_offset);
 }
@@ -4121,10 +4122,10 @@ init_elim_table (void)
    be substituted eventually by altering the REG-rtx's.  */
 
 static void
-init_eliminable_invariants (rtx first, bool do_subregs)
+init_eliminable_invariants (rtx_base_insn first, bool do_subregs)
 {
   int i;
-  rtx insn;
+  rtx_base_insn insn;
 
   grow_reg_equivs ();
   if (do_subregs)
-- 
1.7.11.7

