diff mbox

[committed] params 2 and 3 of reg_set_between_p

Message ID 1410530885.2874.21.camel@surprise
State New
Headers show

Commit Message

David Malcolm Sept. 12, 2014, 2:08 p.m. UTC
The attached patch strengthens the "from_insn" and "to_insn" params of
reg_set_between_p from rtx to rtx_insn * (along with some vars at a
couple of callsites), and thus falls under the pre-approval granted by
Jeff here:
  https://gcc.gnu.org/ml/gcc-patches/2014-08/msg01310.html

Bootstrapped on x86_64-unknown-linux-gnu (Fedora 20), and has been
rebuilt as part of a config-list.mk build for all working configurations
(albeit with other patches for the latter case).

Committed to trunk as r215222.
diff mbox

Patch

Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c	(revision 215221)
+++ gcc/rtlanal.c	(revision 215222)
@@ -947,10 +947,9 @@ 
    FROM_INSN and TO_INSN (exclusive of those two).  */
 
 int
-reg_set_between_p (const_rtx reg, const_rtx uncast_from_insn, const_rtx to_insn)
+reg_set_between_p (const_rtx reg, const rtx_insn *from_insn,
+		   const rtx_insn *to_insn)
 {
-  const rtx_insn *from_insn =
-    safe_as_a <const rtx_insn *> (uncast_from_insn);
   const rtx_insn *insn;
 
   if (from_insn == to_insn)
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 215221)
+++ gcc/ChangeLog	(revision 215222)
@@ -1,3 +1,13 @@ 
+2014-09-12  David Malcolm  <dmalcolm@redhat.com>
+
+	* config/alpha/alpha.c (alpha_ra_ever_killed): Replace NULL_RTX
+	with NULL when dealing with an insn.
+	* config/sh/sh.c (sh_reorg): Strengthen local "last_float_move"
+	from rtx to rtx_insn *.
+	* rtl.h (reg_set_between_p): Strengthen params 2 and 3 from
+	const_rtx to const rtx_insn *.
+	* rtlanal.c (reg_set_between_p): Likewise, removing a checked cast.
+
 2014-09-12  Trevor Saunders  <tsaunders@mozilla.com>
 
 	* hash-table.h (gt_pch_nx): Don't call gt_pch_note_object within an
Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h	(revision 215221)
+++ gcc/rtl.h	(revision 215222)
@@ -2759,7 +2759,7 @@ 
 extern int count_occurrences (const_rtx, const_rtx, int);
 extern int reg_referenced_p (const_rtx, const_rtx);
 extern int reg_used_between_p (const_rtx, const rtx_insn *, const rtx_insn *);
-extern int reg_set_between_p (const_rtx, const_rtx, const_rtx);
+extern int reg_set_between_p (const_rtx, const rtx_insn *, const rtx_insn *);
 extern int commutative_operand_precedence (rtx);
 extern bool swap_commutative_operands_p (rtx, rtx);
 extern int modified_between_p (const_rtx, const rtx_insn *, const rtx_insn *);
Index: gcc/config/alpha/alpha.c
===================================================================
--- gcc/config/alpha/alpha.c	(revision 215221)
+++ gcc/config/alpha/alpha.c	(revision 215222)
@@ -5001,7 +5001,7 @@ 
   top = get_insns ();
   pop_topmost_sequence ();
 
-  return reg_set_between_p (gen_rtx_REG (Pmode, REG_RA), top, NULL_RTX);
+  return reg_set_between_p (gen_rtx_REG (Pmode, REG_RA), top, NULL);
 }
 
 
Index: gcc/config/sh/sh.c
===================================================================
--- gcc/config/sh/sh.c	(revision 215221)
+++ gcc/config/sh/sh.c	(revision 215222)
@@ -6281,7 +6281,8 @@ 
 	  /* Scan ahead looking for a barrier to stick the constant table
 	     behind.  */
 	  rtx_insn *barrier = find_barrier (num_mova, mova, insn);
-	  rtx last_float_move = NULL_RTX, last_float = 0, *last_float_addr = NULL;
+	  rtx_insn *last_float_move = NULL;
+	  rtx last_float = 0, *last_float_addr = NULL;
 	  int need_aligned_label = 0;
 
 	  if (num_mova && ! mova_p (mova))