[11/13] type reg_equiv_init as rtx_insn_list
diff mbox

Message ID 1430600503-14069-12-git-send-email-tbsaunde+gcc@tbsaunde.org
State New
Headers show

Commit Message

tbsaunde+gcc@tbsaunde.org May 2, 2015, 9:01 p.m. UTC
From: Trevor Saunders <tsaunders@mozilla.com>

gcc/ChangeLog:

2015-05-02  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* reload.h (struct reg_equivs_t): Change type of init to
	rtx_insn *.
	* ira.c (fix_reg_equiv_init): Adjust.
	* reload1.c (eliminate_regs_1): Likewise.
	(init_eliminable_invariants): Likewise.
---
 gcc/ChangeLog |  8 ++++++++
 gcc/ira.c     | 12 +++++++-----
 gcc/reload.h  |  2 +-
 gcc/reload1.c |  8 ++++----
 4 files changed, 20 insertions(+), 10 deletions(-)

Patch
diff mbox

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d3e23bd..59fa7f7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@ 
 2015-05-02  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
 
+	* reload.h (struct reg_equivs_t): Change type of init to
+	rtx_insn *.
+	* ira.c (fix_reg_equiv_init): Adjust.
+	* reload1.c (eliminate_regs_1): Likewise.
+	(init_eliminable_invariants): Likewise.
+
+2015-05-02  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>
+
 	* cselib.c (fp_setter_insn): Take a rtx_insn *.
 	* cselib.h (fp_setter_insn): Adjust.
 
diff --git a/gcc/ira.c b/gcc/ira.c
index 25baa90..ab8e9ce 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -2709,20 +2709,22 @@  fix_reg_equiv_init (void)
 {
   int max_regno = max_reg_num ();
   int i, new_regno, max;
-  rtx x, prev, next, insn, set;
+  rtx set;
+  rtx_insn_list *x, *next, *prev;
+  rtx_insn *insn;
 
   if (max_regno_before_ira < max_regno)
     {
       max = vec_safe_length (reg_equivs);
       grow_reg_equivs ();
       for (i = FIRST_PSEUDO_REGISTER; i < max; i++)
-	for (prev = NULL_RTX, x = reg_equiv_init (i);
+	for (prev = NULL, x = reg_equiv_init (i);
 	     x != NULL_RTX;
 	     x = next)
 	  {
-	    next = XEXP (x, 1);
-	    insn = XEXP (x, 0);
-	    set = single_set (as_a <rtx_insn *> (insn));
+	    next = x->next ();
+	    insn = x->insn ();
+	    set = single_set (insn);
 	    ira_assert (set != NULL_RTX
 			&& (REG_P (SET_DEST (set)) || REG_P (SET_SRC (set))));
 	    if (REG_P (SET_DEST (set))
diff --git a/gcc/reload.h b/gcc/reload.h
index c777e54..a58b902 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -239,7 +239,7 @@  struct reg_equivs_t
 
   /* The list of insns that initialized reg N from its equivalent
      constant or memory slot.  */
-  rtx init;
+  rtx_insn_list *init;
 };
 
 #define reg_equiv_constant(ELT) \
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 82b106e..4c47906 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -2619,7 +2619,7 @@  eliminate_regs_1 (rtx x, machine_mode mem_mode, rtx insn,
 			             mem_mode, insn, true, for_costs);
 	  /* There exists at least one use of REGNO that cannot be
 	     eliminated.  Prevent the defining insn from being deleted.  */
-	  reg_equiv_init (regno) = NULL_RTX;
+	  reg_equiv_init (regno) = NULL;
 	  if (!for_costs)
 	    alter_reg (regno, -1, true);
 	}
@@ -4252,17 +4252,17 @@  init_eliminable_invariants (rtx_insn *first, bool do_subregs)
 		    {
 		      reg_equiv_memory_loc (i) = force_const_mem (mode, x);
 		      if (! reg_equiv_memory_loc (i))
-			reg_equiv_init (i) = NULL_RTX;
+			reg_equiv_init (i) = NULL;
 		    }
 		}
 	      else
 		{
-		  reg_equiv_init (i) = NULL_RTX;
+		  reg_equiv_init (i) = NULL;
 		  continue;
 		}
 	    }
 	  else
-	    reg_equiv_init (i) = NULL_RTX;
+	    reg_equiv_init (i) = NULL;
 	}
     }