public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 03/11] make find_reg_equal_equiv_note take rtx_insn *
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (9 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 05/11] make replace_label_in_insn take labels as " tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14 13:45 ` [PATCH 00/11] more rtx_insn * stuff Bernd Schmidt
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* cse.c (count_reg_usage): Adjust.
	* rtl.h: Adjust prototypes.
	* rtlanal.c (find_reg_equal_equiv_note): Change argument type to
rtx_insn *.
---
 gcc/cse.c     | 63 +++++++++++++++++++++++++++++++----------------------------
 gcc/rtl.h     |  2 +-
 gcc/rtlanal.c |  2 +-
 3 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/gcc/cse.c b/gcc/cse.c
index 11b8fbe..a2d8b4f 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -6824,37 +6824,40 @@ count_reg_usage (rtx x, int *counts, rtx dest, int incr)
     case CALL_INSN:
     case INSN:
     case JUMP_INSN:
-      /* We expect dest to be NULL_RTX here.  If the insn may throw,
-	 or if it cannot be deleted due to side-effects, mark this fact
-	 by setting DEST to pc_rtx.  */
-      if ((!cfun->can_delete_dead_exceptions && !insn_nothrow_p (x))
-	  || side_effects_p (PATTERN (x)))
-	dest = pc_rtx;
-      if (code == CALL_INSN)
-	count_reg_usage (CALL_INSN_FUNCTION_USAGE (x), counts, dest, incr);
-      count_reg_usage (PATTERN (x), counts, dest, incr);
-
-      /* Things used in a REG_EQUAL note aren't dead since loop may try to
-	 use them.  */
-
-      note = find_reg_equal_equiv_note (x);
-      if (note)
-	{
-	  rtx eqv = XEXP (note, 0);
+      {
+	rtx_insn *insn = as_a<rtx_insn *> (x);
+	/* We expect dest to be NULL_RTX here.  If the insn may throw,
+	   or if it cannot be deleted due to side-effects, mark this fact
+	   by setting DEST to pc_rtx.  */
+	if ((!cfun->can_delete_dead_exceptions && !insn_nothrow_p (x))
+	    || side_effects_p (PATTERN (x)))
+	  dest = pc_rtx;
+	if (code == CALL_INSN)
+	  count_reg_usage (CALL_INSN_FUNCTION_USAGE (x), counts, dest, incr);
+	count_reg_usage (PATTERN (x), counts, dest, incr);
+
+	/* Things used in a REG_EQUAL note aren't dead since loop may try to
+	   use them.  */
+
+	note = find_reg_equal_equiv_note (insn);
+	if (note)
+	  {
+	    rtx eqv = XEXP (note, 0);
 
-	  if (GET_CODE (eqv) == EXPR_LIST)
-	  /* This REG_EQUAL note describes the result of a function call.
-	     Process all the arguments.  */
-	    do
-	      {
-		count_reg_usage (XEXP (eqv, 0), counts, dest, incr);
-		eqv = XEXP (eqv, 1);
-	      }
-	    while (eqv && GET_CODE (eqv) == EXPR_LIST);
-	  else
-	    count_reg_usage (eqv, counts, dest, incr);
-	}
-      return;
+	    if (GET_CODE (eqv) == EXPR_LIST)
+	      /* This REG_EQUAL note describes the result of a function call.
+		 Process all the arguments.  */
+	      do
+		{
+		  count_reg_usage (XEXP (eqv, 0), counts, dest, incr);
+		  eqv = XEXP (eqv, 1);
+		}
+	      while (eqv && GET_CODE (eqv) == EXPR_LIST);
+	    else
+	      count_reg_usage (eqv, counts, dest, incr);
+	  }
+	return;
+      }
 
     case EXPR_LIST:
       if (REG_NOTE_KIND (x) == REG_EQUAL
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 7a44e3b..dc308f2 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3011,7 +3011,7 @@ extern int dead_or_set_p (const_rtx, const_rtx);
 extern int dead_or_set_regno_p (const_rtx, unsigned int);
 extern rtx find_reg_note (const_rtx, enum reg_note, const_rtx);
 extern rtx find_regno_note (const_rtx, enum reg_note, unsigned int);
-extern rtx find_reg_equal_equiv_note (const_rtx);
+extern rtx find_reg_equal_equiv_note (const rtx_insn *);
 extern rtx find_constant_src (const rtx_insn *);
 extern int find_reg_fusage (const_rtx, enum rtx_code, const_rtx);
 extern int find_regno_fusage (const_rtx, enum rtx_code, unsigned int);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 4617e8e..7a89c03 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2113,7 +2113,7 @@ find_regno_note (const_rtx insn, enum reg_note kind, unsigned int regno)
    has such a note.  */
 
 rtx
-find_reg_equal_equiv_note (const_rtx insn)
+find_reg_equal_equiv_note (const rtx_insn *insn)
 {
   rtx link;
 
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 01/11] use rtx_insn * more places where it is obvious
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 09/11] make add_int_reg_note take rtx_insn * tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-22 10:10   ` Andreas Schwab
  2016-11-14  8:01 ` [PATCH 11/11] make find_reg{,no}_fusage take rtx_insn * tbsaunde+gcc
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/arm/arm.c (legitimize_pic_address): Change to use
	rtx_insn * as the type of variables.
	(arm_pic_static_addr): Likewise.
	(arm_emit_movpair): Likewise.
	* config/c6x/c6x.c (reorg_split_calls): Likewise.
	* config/darwin.c (machopic_legitimize_pic_address): Likewise.
	* config/frv/frv.c (frv_optimize_membar_local): Likewise.
	* config/frv/frv.md: Likewise.
	* config/i386/i386-protos.h: Likewise.
	* config/i386/i386.c (ix86_expand_split_stack_prologue):
Likewise.
	(ix86_split_fp_branch): Likewise.
	(predict_jump): Likewise.
	* config/ia64/ia64.c: Likewise.
	* config/mcore/mcore.c: Likewise.
	* config/rs6000/rs6000.c (rs6000_legitimize_tls_address):
Likewise.
	* config/s390/s390.c: Likewise.
	* config/s390/s390.md: Likewise.
	* config/spu/spu.md: Likewise.
	* config/tilegx/tilegx.c (tilegx_legitimize_tls_address):
Likewise.
	* lower-subreg.c (resolve_simple_move): Likewise.
---
 gcc/config/arm/arm.c          | 18 +++++++-----------
 gcc/config/c6x/c6x.c          |  5 +++--
 gcc/config/darwin.c           |  3 +--
 gcc/config/frv/frv.c          |  4 ++--
 gcc/config/frv/frv.md         | 20 ++++++++------------
 gcc/config/i386/i386-protos.h |  6 +++---
 gcc/config/i386/i386.c        | 14 +++++++-------
 gcc/config/ia64/ia64.c        |  2 +-
 gcc/config/mcore/mcore.c      |  2 +-
 gcc/config/rs6000/rs6000.c    |  4 ++--
 gcc/config/s390/s390.c        |  2 +-
 gcc/config/s390/s390.md       | 21 ++++++++++++++-------
 gcc/config/spu/spu.md         |  6 +++---
 gcc/config/tilegx/tilegx.c    |  3 ++-
 gcc/lower-subreg.c            |  2 +-
 15 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 239117f..c2bc833 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -252,7 +252,7 @@ static bool arm_can_eliminate (const int, const int);
 static void arm_asm_trampoline_template (FILE *);
 static void arm_trampoline_init (rtx, tree, rtx);
 static rtx arm_trampoline_adjust_address (rtx);
-static rtx arm_pic_static_addr (rtx orig, rtx reg);
+static rtx_insn *arm_pic_static_addr (rtx orig, rtx reg);
 static bool cortex_a9_sched_adjust_cost (rtx_insn *, int, rtx_insn *, int *);
 static bool xscale_sched_adjust_cost (rtx_insn *, int, rtx_insn *, int *);
 static bool fa726te_sched_adjust_cost (rtx_insn *, int, rtx_insn *, int *);
@@ -6903,8 +6903,6 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
   if (GET_CODE (orig) == SYMBOL_REF
       || GET_CODE (orig) == LABEL_REF)
     {
-      rtx insn;
-
       if (reg == 0)
 	{
 	  gcc_assert (can_create_pseudo_p ());
@@ -6917,6 +6915,7 @@ legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
 	 same segment as the GOT.  Unfortunately, the flexibility of linker
 	 scripts means that we can't be sure of that in general, so assume
 	 that GOTOFF is never valid on VxWorks.  */
+      rtx_insn *insn;
       if ((GET_CODE (orig) == LABEL_REF
 	   || (GET_CODE (orig) == SYMBOL_REF &&
 	       SYMBOL_REF_LOCAL_P (orig)))
@@ -7155,10 +7154,10 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED)
 }
 
 /* Generate code to load the address of a static var when flag_pic is set.  */
-static rtx
+static rtx_insn *
 arm_pic_static_addr (rtx orig, rtx reg)
 {
-  rtx l1, labelno, offset_rtx, insn;
+  rtx l1, labelno, offset_rtx;
 
   gcc_assert (flag_pic);
 
@@ -7175,8 +7174,7 @@ arm_pic_static_addr (rtx orig, rtx reg)
                                UNSPEC_SYMBOL_OFFSET);
   offset_rtx = gen_rtx_CONST (Pmode, offset_rtx);
 
-  insn = emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno));
-  return insn;
+  return emit_insn (gen_pic_load_addr_unified (reg, offset_rtx, labelno));
 }
 
 /* Return nonzero if X is valid as an ARM state addressing register.  */
@@ -16928,8 +16926,6 @@ output_mov_long_double_arm_from_arm (rtx *operands)
 void
 arm_emit_movpair (rtx dest, rtx src)
  {
-  rtx insn;
-
   /* If the src is an immediate, simplify it.  */
   if (CONST_INT_P (src))
     {
@@ -16940,14 +16936,14 @@ arm_emit_movpair (rtx dest, rtx src)
 	  emit_set_insn (gen_rtx_ZERO_EXTRACT (SImode, dest, GEN_INT (16),
 					       GEN_INT (16)),
 			 GEN_INT ((val >> 16) & 0x0000ffff));
-	  insn = get_last_insn ();
+	  rtx_insn *insn = get_last_insn ();
 	  set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
 	}
       return;
     }
    emit_set_insn (dest, gen_rtx_HIGH (SImode, src));
    emit_set_insn (dest, gen_rtx_LO_SUM (SImode, dest, src));
-   insn = get_last_insn ();
+   rtx_insn *insn = get_last_insn ();
    set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
  }
 
diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c
index 6cb9185..4d7dd72 100644
--- a/gcc/config/c6x/c6x.c
+++ b/gcc/config/c6x/c6x.c
@@ -4729,7 +4729,7 @@ c6x_gen_bundles (void)
 /* Emit a NOP instruction for CYCLES cycles after insn AFTER.  Return it.  */
 
 static rtx_insn *
-emit_nop_after (int cycles, rtx after)
+emit_nop_after (int cycles, rtx_insn *after)
 {
   rtx_insn *insn;
 
@@ -4994,7 +4994,8 @@ reorg_split_calls (rtx_insn **call_labels)
 	      else
 		{
 		  rtx x1, x2;
-		  rtx after2 = find_next_cycle_insn (after1, this_clock + 2);
+		  rtx_insn *after2 = find_next_cycle_insn (after1,
+							   this_clock + 2);
 		  if (after2 == NULL_RTX)
 		    after2 = after1;
 		  x2 = gen_movsi_lo_sum (reg, reg, labelref);
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index ff8600c..e9ce6d2 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -843,7 +843,6 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
 				? reg
 				: gen_reg_rtx (Pmode));
 	      rtx mem;
-	      rtx insn;
 	      rtx sum;
 
 	      sum = gen_rtx_HIGH (Pmode, offset);
@@ -856,7 +855,7 @@ machopic_legitimize_pic_address (rtx orig, machine_mode mode, rtx reg)
 				  gen_rtx_LO_SUM (Pmode,
 						  hi_sum_reg,
 						  copy_rtx (offset)));
-	      insn = emit_insn (gen_rtx_SET (reg, mem));
+	      rtx_insn *insn = emit_insn (gen_rtx_SET (reg, mem));
 	      set_unique_reg_note (insn, REG_EQUAL, pic_ref);
 
 	      pic_ref = reg;
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index fb01685..b2177ab 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -7797,8 +7797,8 @@ frv_optimize_membar_local (basic_block bb, struct frv_io *next_io,
 			   rtx_insn **last_membar)
 {
   HARD_REG_SET used_regs;
-  rtx next_membar, set;
-  rtx_insn *insn;
+  rtx set;
+  rtx_insn *insn, *next_membar;
   bool next_is_end_p;
 
   /* NEXT_IO is the next I/O operation to be performed after the current
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index 931a71d..d59936d 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -7347,9 +7347,8 @@
   ""
   "
 {
-  rtx insn;
-
-  insn = emit_insn (gen_symGOT2reg_i (operands[0], operands[1], operands[2], operands[3]));
+  rtx_insn *insn = emit_insn (gen_symGOT2reg_i (operands[0], operands[1],
+						operands[2], operands[3]));
 
   MEM_READONLY_P (SET_SRC (PATTERN (insn))) = 1;
 
@@ -7431,7 +7430,8 @@
   ""
   "
 {
-  rtx insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1], operands[2], operands[3]));
+  rtx_insn *insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1],
+						   operands[2], operands[3]));
 
   set_unique_reg_note (insn, REG_EQUAL, operands[1]);
 
@@ -7457,8 +7457,6 @@
   ""
   "
 {
-  rtx insn;
-
   if (!can_create_pseudo_p ())
     operands[4] = operands[0];
   else
@@ -7466,8 +7464,8 @@
 
   emit_insn (frv_gen_GPsym2reg (operands[4], operands[2]));
 
-  insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1],
-					 operands[4], operands[3]));
+  rtx_insn *insn = emit_insn (gen_symGOTOFF2reg_i (operands[0], operands[1],
+						   operands[4], operands[3]));
 
   set_unique_reg_note (insn, REG_EQUAL, operands[1]);
 
@@ -7483,8 +7481,6 @@
   ""
   "
 {
-  rtx insn;
-
   if (!can_create_pseudo_p ())
     {
       emit_insn (gen_symGOT2reg (operands[0], operands[1], operands[2],
@@ -7496,8 +7492,8 @@
 
   emit_insn (frv_gen_GPsym2reg (operands[4], operands[2]));
 
-  insn = emit_insn (gen_symGOTOFF2reg_hilo (operands[0], operands[1],
-					    operands[4], operands[3]));
+  rtx_insn *insn = emit_insn (gen_symGOTOFF2reg_hilo (operands[0], operands[1],
+						      operands[4], operands[3]));
 
   set_unique_reg_note (insn, REG_EQUAL, operands[1]);
 
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 8eeb072..edd6cbe 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -77,10 +77,10 @@ extern void ix86_print_operand (FILE *, rtx, int);
 extern void split_double_mode (machine_mode, rtx[], int, rtx[], rtx[]);
 
 extern const char *output_set_got (rtx, rtx);
-extern const char *output_387_binary_op (rtx, rtx*);
-extern const char *output_387_reg_move (rtx, rtx*);
+extern const char *output_387_binary_op (rtx_insn *, rtx*);
+extern const char *output_387_reg_move (rtx_insn *, rtx*);
 extern const char *output_fix_trunc (rtx_insn *, rtx*, bool);
-extern const char *output_fp_compare (rtx, rtx*, bool, bool);
+extern const char *output_fp_compare (rtx_insn *, rtx*, bool, bool);
 extern const char *output_adjust_stack_and_probe (rtx);
 extern const char *output_probe_stack_range (rtx, rtx);
 
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index a5c4ba7..4a2452b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -14700,7 +14700,7 @@ ix86_expand_split_stack_prologue (void)
   HOST_WIDE_INT allocate;
   unsigned HOST_WIDE_INT args_size;
   rtx_code_label *label;
-  rtx limit, current, jump_insn, allocate_rtx, call_insn, call_fusage;
+  rtx limit, current, allocate_rtx, call_insn, call_fusage;
   rtx scratch_reg = NULL_RTX;
   rtx_code_label *varargs_label = NULL;
   rtx fn;
@@ -14760,7 +14760,7 @@ ix86_expand_split_stack_prologue (void)
     }
 
   ix86_expand_branch (GEU, current, limit, label);
-  jump_insn = get_last_insn ();
+  rtx_insn *jump_insn = get_last_insn ();
   JUMP_LABEL (jump_insn) = label;
 
   /* Mark the jump as very likely to be taken.  */
@@ -18654,7 +18654,7 @@ split_double_mode (machine_mode mode, rtx operands[],
 #endif
 
 const char *
-output_387_binary_op (rtx insn, rtx *operands)
+output_387_binary_op (rtx_insn *insn, rtx *operands)
 {
   static char buf[40];
   const char *p;
@@ -19392,7 +19392,7 @@ output_387_ffreep (rtx *operands ATTRIBUTE_UNUSED, int opno)
    should be used.  UNORDERED_P is true when fucom should be used.  */
 
 const char *
-output_fp_compare (rtx insn, rtx *operands, bool eflags_p, bool unordered_p)
+output_fp_compare (rtx_insn *insn, rtx *operands, bool eflags_p, bool unordered_p)
 {
   int stack_top_dies;
   rtx cmp_op0, cmp_op1;
@@ -22775,7 +22775,7 @@ ix86_split_fp_branch (enum rtx_code code, rtx op1, rtx op2,
 		      rtx target1, rtx target2, rtx tmp)
 {
   rtx condition;
-  rtx i;
+  rtx_insn *i;
 
   if (target2 != pc_rtx)
     {
@@ -25834,7 +25834,7 @@ ix86_split_lshr (rtx *operands, rtx scratch, machine_mode mode)
 static void
 predict_jump (int prob)
 {
-  rtx insn = get_last_insn ();
+  rtx_insn *insn = get_last_insn ();
   gcc_assert (JUMP_P (insn));
   add_int_reg_note (insn, REG_BR_PROB, prob);
 }
@@ -43825,7 +43825,7 @@ ix86_reverse_condition (enum rtx_code code, machine_mode mode)
    to OPERANDS[0].  */
 
 const char *
-output_387_reg_move (rtx insn, rtx *operands)
+output_387_reg_move (rtx_insn *insn, rtx *operands)
 {
   if (REG_P (operands[0]))
     {
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 8557157..c8dbb4c 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -7238,7 +7238,7 @@ ia64_adjust_cost (rtx_insn *insn, int dep_type1, rtx_insn *dep_insn,
    ??? When cycle display notes are implemented, update this.  */
 
 static void
-ia64_emit_insn_before (rtx insn, rtx before)
+ia64_emit_insn_before (rtx insn, rtx_insn *before)
 {
   emit_insn_before (insn, before);
 }
diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c
index bdb8431..2d4a911 100644
--- a/gcc/config/mcore/mcore.c
+++ b/gcc/config/mcore/mcore.c
@@ -2327,7 +2327,7 @@ is_cond_candidate (rtx insn)
    new one.  Return the new insn if emitted.  */
 
 static rtx_insn *
-emit_new_cond_insn (rtx insn, int cond)
+emit_new_cond_insn (rtx_insn *insn, int cond)
 {
   rtx c_insn = 0;
   rtx pat, dst, src;
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 609f267..0e05500 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -9099,7 +9099,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
 		rs6000_emit_move (got, gsym, Pmode);
 	      else
 		{
-		  rtx mem, lab, last;
+		  rtx mem, lab;
 
 		  tmp1 = gen_reg_rtx (Pmode);
 		  tmp2 = gen_reg_rtx (Pmode);
@@ -9110,7 +9110,7 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
 		  if (TARGET_LINK_STACK)
 		    emit_insn (gen_addsi3 (tmp1, tmp1, GEN_INT (4)));
 		  emit_move_insn (tmp2, mem);
-		  last = emit_insn (gen_addsi3 (got, tmp1, tmp2));
+		  rtx_insn *last = emit_insn (gen_addsi3 (got, tmp1, tmp2));
 		  set_unique_reg_note (last, REG_EQUAL, gsym);
 		}
 	    }
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 3f98cd8..aeafdd4 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -5566,7 +5566,7 @@ s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len)
 /* Emit a conditional jump to LABEL for condition code mask MASK using
    comparsion operator COMPARISON.  Return the emitted jump insn.  */
 
-static rtx
+static rtx_insn *
 s390_emit_ccraw_jump (HOST_WIDE_INT mask, enum rtx_code comparison, rtx label)
 {
   rtx temp;
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index fedd6f9..a449b03 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -6643,7 +6643,8 @@
    (clobber (match_dup 4))]
   "TARGET_ZARCH"
 {
-  rtx insn, div_equal, mod_equal;
+  rtx div_equal, mod_equal;
+  rtx_insn *insn;
 
   div_equal = gen_rtx_DIV (DImode, operands[1], operands[2]);
   mod_equal = gen_rtx_MOD (DImode, operands[1], operands[2]);
@@ -6707,7 +6708,8 @@
    (clobber (match_dup 4))]
   "TARGET_ZARCH"
 {
-  rtx insn, div_equal, mod_equal, equal;
+  rtx div_equal, mod_equal, equal;
+  rtx_insn *insn;
 
   div_equal = gen_rtx_UDIV (DImode, operands[1], operands[2]);
   mod_equal = gen_rtx_UMOD (DImode, operands[1], operands[2]);
@@ -6767,7 +6769,8 @@
    (clobber (match_dup 4))]
   "!TARGET_ZARCH"
 {
-  rtx insn, div_equal, mod_equal, equal;
+  rtx div_equal, mod_equal, equal;
+  rtx_insn *insn;
 
   div_equal = gen_rtx_DIV (SImode, operands[1], operands[2]);
   mod_equal = gen_rtx_MOD (SImode, operands[1], operands[2]);
@@ -6825,7 +6828,8 @@
    (clobber (match_dup 4))]
   "!TARGET_ZARCH && TARGET_CPU_ZARCH"
 {
-  rtx insn, div_equal, mod_equal, equal;
+  rtx div_equal, mod_equal, equal;
+  rtx_insn *insn;
 
   div_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
   mod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
@@ -6879,7 +6883,8 @@
    (clobber (match_dup 3))]
   "!TARGET_ZARCH && !TARGET_CPU_ZARCH"
 {
-  rtx insn, udiv_equal, umod_equal, equal;
+  rtx udiv_equal, umod_equal, equal;
+  rtx_insn *insn;
 
   udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
   umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
@@ -6965,7 +6970,8 @@
    (clobber (match_dup 3))]
   "!TARGET_ZARCH && !TARGET_CPU_ZARCH"
 {
-  rtx insn, udiv_equal, umod_equal, equal;
+  rtx udiv_equal, umod_equal, equal;
+  rtx_insn *insn;
 
   udiv_equal = gen_rtx_UDIV (SImode, operands[1], operands[2]);
   umod_equal = gen_rtx_UMOD (SImode, operands[1], operands[2]);
@@ -8599,7 +8605,8 @@
 	(clz:DI (match_operand:DI 1 "register_operand" "d")))]
   "TARGET_EXTIMM && TARGET_ZARCH"
 {
-  rtx insn, clz_equal;
+  rtx_insn *insn;
+  rtx clz_equal;
   rtx wide_reg = gen_reg_rtx (TImode);
   rtx msb = gen_rtx_CONST_INT (DImode, (unsigned HOST_WIDE_INT) 1 << 63);
 
diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md
index 6e0cf93..1061cb8 100644
--- a/gcc/config/spu/spu.md
+++ b/gcc/config/spu/spu.md
@@ -848,7 +848,7 @@
         (unsigned_float:DF (match_operand:SI 1 "register_operand"   "r")))]
   ""
   "{
-    rtx value, insns;
+    rtx value;
     rtx c0 = spu_const_from_ints (V16QImode, 0x02031011, 0x12138080, 
                                              0x06071415, 0x16178080);
     rtx r0 = gen_reg_rtx (V16QImode);
@@ -860,7 +860,7 @@
          emit_library_call_value (convert_optab_libfunc (ufloat_optab,
                                                          DFmode, SImode),
                    NULL_RTX, LCT_NORMAL, DFmode, 1, operands[1], SImode);
-       insns = get_insns ();
+       rtx_insn *insns = get_insns ();
        end_sequence ();
        emit_libcall_block (insns, operands[0], value,
                            gen_rtx_UNSIGNED_FLOAT (DFmode, operands[1]));
@@ -953,7 +953,7 @@
          emit_library_call_value (convert_optab_libfunc (ufloat_optab,
                                                          DFmode, DImode),
                    NULL_RTX, LCT_NORMAL, DFmode, 1, operands[1], DImode);
-      insns = get_insns ();
+      rtx_insn *insns = get_insns ();
       end_sequence ();
       emit_libcall_block (insns, operands[0], value,
                           gen_rtx_UNSIGNED_FLOAT (DFmode, operands[1]));
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index 76a7455..85a2eec 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -988,7 +988,7 @@ tilegx_legitimize_tls_address (rtx addr)
       case TLS_MODEL_GLOBAL_DYNAMIC:
       case TLS_MODEL_LOCAL_DYNAMIC:
 	{
-	  rtx r0, temp, temp2, temp3, got, last;
+	  rtx r0, temp, temp2, temp3, got;
 
 	  ret = gen_reg_rtx (Pmode);
 	  r0 = gen_rtx_REG (Pmode, 0);
@@ -1023,6 +1023,7 @@ tilegx_legitimize_tls_address (rtx addr)
 
 	  emit_move_insn (temp3, r0);
 
+	  rtx_insn *last;
 	  if (TARGET_32BIT)
 	    last = emit_insn (gen_tls_gd_add_32bit (ret, temp3, addr));
 	  else
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index 9675eed..6b75f62 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -935,7 +935,7 @@ resolve_simple_move (rtx set, rtx_insn *insn)
 
       if (AUTO_INC_DEC)
 	{
-	  rtx move = emit_move_insn (reg, src);
+	  rtx_insn *move = emit_move_insn (reg, src);
 	  if (MEM_P (src))
 	    {
 	      rtx note = find_reg_note (insn, REG_INC, NULL_RTX);
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 02/11] split up variables to use rtx_insn * more
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (2 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 11/11] make find_reg{,no}_fusage take rtx_insn * tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 08/11] make prologue_epilogue_contains take a rtx_insn * tbsaunde+gcc
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/aarch64/aarch64.c (aarch64_emit_unlikely_jump): split
	up variables to make some rtx_insn *.
	* config/alpha/alpha.c (emit_unlikely_jump): Likewise.
	* config/arc/arc.c: Likewise.
	* config/arm/arm.c: Likewise.
	* config/mn10300/mn10300.c (mn10300_legitimize_pic_address):
	Likewise.
	* config/rs6000/rs6000.c (rs6000_expand_split_stack_prologue):
	Likewise.
	* config/spu/spu.c (spu_emit_branch_hint): Likewise.
---
 gcc/config/aarch64/aarch64.c |  4 ++--
 gcc/config/alpha/alpha.c     |  8 +++-----
 gcc/config/arc/arc.c         |  4 ++--
 gcc/config/arm/arm.c         |  4 ++--
 gcc/config/mn10300/mn10300.c |  9 +++++----
 gcc/config/rs6000/rs6000.c   | 14 ++++++--------
 gcc/config/spu/spu.c         |  7 +++----
 7 files changed, 23 insertions(+), 27 deletions(-)

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index b7d4640..b6676f1 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -11474,8 +11474,8 @@ aarch64_emit_unlikely_jump (rtx insn)
 {
   int very_unlikely = REG_BR_PROB_BASE / 100 - 1;
 
-  insn = emit_jump_insn (insn);
-  add_int_reg_note (insn, REG_BR_PROB, very_unlikely);
+  rtx_insn *jump = emit_jump_insn (insn);
+  add_int_reg_note (jump, REG_BR_PROB, very_unlikely);
 }
 
 /* Expand a compare and swap pattern.  */
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 6d390ae..6c63a8f 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -4320,11 +4320,9 @@ static void
 emit_unlikely_jump (rtx cond, rtx label)
 {
   int very_unlikely = REG_BR_PROB_BASE / 100 - 1;
-  rtx x;
-
-  x = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, label, pc_rtx);
-  x = emit_jump_insn (gen_rtx_SET (pc_rtx, x));
-  add_int_reg_note (x, REG_BR_PROB, very_unlikely);
+  rtx x = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, label, pc_rtx);
+  rtx_insn *insn = emit_jump_insn (gen_rtx_SET (pc_rtx, x));
+  add_int_reg_note (insn, REG_BR_PROB, very_unlikely);
 }
 
 /* A subroutine of the atomic operation splitters.  Emit a load-locked
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 5ba7ccc..dbaad24 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -9523,8 +9523,8 @@ emit_unlikely_jump (rtx insn)
 {
   int very_unlikely = REG_BR_PROB_BASE / 100 - 1;
 
-  insn = emit_jump_insn (insn);
-  add_int_reg_note (insn, REG_BR_PROB, very_unlikely);
+  rtx_insn *jump = emit_jump_insn (insn);
+  add_int_reg_note (jump, REG_BR_PROB, very_unlikely);
 }
 
 /* Expand code to perform a 8 or 16-bit compare and swap by doing
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index c2bc833..3e63330 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -26931,8 +26931,8 @@ emit_unlikely_jump (rtx insn)
 {
   int very_unlikely = REG_BR_PROB_BASE / 100 - 1;
 
-  insn = emit_jump_insn (insn);
-  add_int_reg_note (insn, REG_BR_PROB, very_unlikely);
+  rtx_insn *jump = emit_jump_insn (insn);
+  add_int_reg_note (jump, REG_BR_PROB, very_unlikely);
 }
 
 /* Expand a compare and swap pattern.  */
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index e61bf40..cfc8604 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -1860,6 +1860,7 @@ rtx
 mn10300_legitimize_pic_address (rtx orig, rtx reg)
 {
   rtx x;
+  rtx_insn *insn;
 
   if (GET_CODE (orig) == LABEL_REF
       || (GET_CODE (orig) == SYMBOL_REF
@@ -1873,7 +1874,7 @@ mn10300_legitimize_pic_address (rtx orig, rtx reg)
       x = gen_rtx_CONST (SImode, x);
       emit_move_insn (reg, x);
 
-      x = emit_insn (gen_addsi3 (reg, reg, pic_offset_table_rtx));
+      insn = emit_insn (gen_addsi3 (reg, reg, pic_offset_table_rtx));
     }
   else if (GET_CODE (orig) == SYMBOL_REF)
     {
@@ -1885,12 +1886,12 @@ mn10300_legitimize_pic_address (rtx orig, rtx reg)
       x = gen_rtx_PLUS (SImode, pic_offset_table_rtx, x);
       x = gen_const_mem (SImode, x);
 
-      x = emit_move_insn (reg, x);
+      insn = emit_move_insn (reg, x);
     }
   else
     return orig;
 
-  set_unique_reg_note (x, REG_EQUAL, orig);
+  set_unique_reg_note (insn, REG_EQUAL, orig);
   return reg;
 }
 
@@ -3163,7 +3164,7 @@ mn10300_bundle_liw (void)
    Insert a SETLB insn just before LABEL.  */
 
 static void
-mn10300_insert_setlb_lcc (rtx_insn *label, rtx branch)
+mn10300_insert_setlb_lcc (rtx_insn *label, rtx_insn *branch)
 {
   rtx lcc, comparison, cmp_reg;
 
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 0e05500..297df64 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -24641,11 +24641,9 @@ static void
 emit_unlikely_jump (rtx cond, rtx label)
 {
   int very_unlikely = REG_BR_PROB_BASE / 100 - 1;
-  rtx x;
-
-  x = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, label, pc_rtx);
-  x = emit_jump_insn (gen_rtx_SET (pc_rtx, x));
-  add_int_reg_note (x, REG_BR_PROB, very_unlikely);
+  rtx x = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, label, pc_rtx);
+  rtx_insn *insn = emit_jump_insn (gen_rtx_SET (pc_rtx, x));
+  add_int_reg_note (insn, REG_BR_PROB, very_unlikely);
 }
 
 /* A subroutine of the atomic operation splitters.  Emit a load-locked
@@ -30555,10 +30553,10 @@ rs6000_expand_split_stack_prologue (void)
 			       gen_rtx_GEU (VOIDmode, compare, const0_rtx),
 			       gen_rtx_LABEL_REF (VOIDmode, ok_label),
 			       pc_rtx);
-  jump = emit_jump_insn (gen_rtx_SET (pc_rtx, jump));
-  JUMP_LABEL (jump) = ok_label;
+  insn = emit_jump_insn (gen_rtx_SET (pc_rtx, jump));
+  JUMP_LABEL (insn) = ok_label;
   /* Mark the jump as very likely to be taken.  */
-  add_int_reg_note (jump, REG_BR_PROB,
+  add_int_reg_note (insn, REG_BR_PROB,
 		    REG_BR_PROB_BASE - REG_BR_PROB_BASE / 100);
 
   lr = gen_rtx_REG (Pmode, LR_REGNO);
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 820924e..e8a3ed9 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -2087,7 +2087,6 @@ static void
 spu_emit_branch_hint (rtx_insn *before, rtx_insn *branch, rtx target,
 		      int distance, sbitmap blocks)
 {
-  rtx branch_label = 0;
   rtx_insn *hint;
   rtx_insn *insn;
   rtx_jump_table_data *table;
@@ -2104,14 +2103,14 @@ spu_emit_branch_hint (rtx_insn *before, rtx_insn *branch, rtx target,
   if (NOTE_INSN_BASIC_BLOCK_P (before))
     before = NEXT_INSN (before);
 
-  branch_label = gen_label_rtx ();
+  rtx_code_label *branch_label = gen_label_rtx ();
   LABEL_NUSES (branch_label)++;
   LABEL_PRESERVE_P (branch_label) = 1;
   insn = emit_label_before (branch_label, branch);
-  branch_label = gen_rtx_LABEL_REF (VOIDmode, branch_label);
+  rtx branch_label_ref = gen_rtx_LABEL_REF (VOIDmode, branch_label);
   bitmap_set_bit (blocks, BLOCK_FOR_INSN (branch)->index);
 
-  hint = emit_insn_before (gen_hbr (branch_label, target), before);
+  hint = emit_insn_before (gen_hbr (branch_label_ref, target), before);
   recog_memoized (hint);
   INSN_LOCATION (hint) = INSN_LOCATION (branch);
   HINTED_P (branch) = 1;
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 06/11] make delete_insn () take a rtx_insn *
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (5 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 04/11] make recog () " tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 07/11] remove cast from emit_libcall_block tbsaunde+gcc
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* cfgrtl.c (delete_insn): Change argument type to rtx_insn *.
	(fixup_reorder_chain): Adjust.
	* cfgrtl.h: Adjust prototype.
---
 gcc/cfgrtl.c | 5 ++---
 gcc/cfgrtl.h | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index d2719db..d0aac09 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -123,9 +123,8 @@ can_delete_label_p (const rtx_code_label *label)
 /* Delete INSN by patching it out.  */
 
 void
-delete_insn (rtx uncast_insn)
+delete_insn (rtx_insn *insn)
 {
-  rtx_insn *insn = as_a <rtx_insn *> (uncast_insn);
   rtx note;
   bool really_delete = true;
 
@@ -3817,7 +3816,7 @@ fixup_reorder_chain (void)
 		  update_br_prob_note (bb);
 		  if (LABEL_NUSES (ret_label) == 0
 		      && single_pred_p (e_taken->dest))
-		    delete_insn (ret_label);
+		    delete_insn (as_a<rtx_insn *> (ret_label));
 		  continue;
 		}
 	    }
diff --git a/gcc/cfgrtl.h b/gcc/cfgrtl.h
index f4c1396..8e2c13c 100644
--- a/gcc/cfgrtl.h
+++ b/gcc/cfgrtl.h
@@ -20,7 +20,7 @@ along with GCC; see the file COPYING3.  If not see
 #ifndef GCC_CFGRTL_H
 #define GCC_CFGRTL_H
 
-extern void delete_insn (rtx);
+extern void delete_insn (rtx_insn *);
 extern bool delete_insn_and_edges (rtx_insn *);
 extern void delete_insn_chain (rtx, rtx_insn *, bool);
 extern basic_block create_basic_block_structure (rtx_insn *, rtx_insn *,
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 09/11] make add_int_reg_note take rtx_insn *
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 01/11] use rtx_insn * more places where it is obvious tbsaunde+gcc
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* rtl.h: Adjust prototype.
	* rtlanal.c (add_int_reg_note): Change argument type to rtx_insn *.
---
 gcc/rtl.h     | 2 +-
 gcc/rtlanal.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/rtl.h b/gcc/rtl.h
index c6c30b5..efb8127 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3017,7 +3017,7 @@ extern int find_reg_fusage (const_rtx, enum rtx_code, const_rtx);
 extern int find_regno_fusage (const_rtx, enum rtx_code, unsigned int);
 extern rtx alloc_reg_note (enum reg_note, rtx, rtx);
 extern void add_reg_note (rtx, enum reg_note, rtx);
-extern void add_int_reg_note (rtx, enum reg_note, int);
+extern void add_int_reg_note (rtx_insn *, enum reg_note, int);
 extern void add_shallow_copy_of_reg_note (rtx_insn *, rtx);
 extern rtx duplicate_reg_note (rtx);
 extern void remove_note (rtx_insn *, const_rtx);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 504b265..75dde3d 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2286,7 +2286,7 @@ add_reg_note (rtx insn, enum reg_note kind, rtx datum)
 /* Add an integer register note with kind KIND and datum DATUM to INSN.  */
 
 void
-add_int_reg_note (rtx insn, enum reg_note kind, int datum)
+add_int_reg_note (rtx_insn *insn, enum reg_note kind, int datum)
 {
   gcc_checking_assert (int_reg_note_p (kind));
   REG_NOTES (insn) = gen_rtx_INT_LIST ((machine_mode) kind,
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 11/11] make find_reg{,no}_fusage take rtx_insn *
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 09/11] make add_int_reg_note take rtx_insn * tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 01/11] use rtx_insn * more places where it is obvious tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 02/11] split up variables to use rtx_insn * more tbsaunde+gcc
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/arm/arm-protos.h: Adjust prototype.
	* config/arm/arm.c (use_return_insn): Change argument type to
	rtx_insn *.
	* rtl.h (is_a_helper ::test): New specialization.
	* rtlanal.c (reg_set_p): Adjust.
	(find_reg_fusage): Change argument type to rtx_insn *.
	(find_regno_fusage): Likewise.
---
 gcc/config/arm/arm-protos.h |  2 +-
 gcc/config/arm/arm.c        |  2 +-
 gcc/rtl.h                   | 12 ++++++++++--
 gcc/rtlanal.c               | 23 +++++++++++++----------
 4 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 95bae5e..539588b 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -23,7 +23,7 @@
 #define GCC_ARM_PROTOS_H
 
 extern enum unwind_info_type arm_except_unwind_info (struct gcc_options *);
-extern int use_return_insn (int, rtx);
+extern int use_return_insn (int, rtx_insn *);
 extern bool use_simple_return_p (void);
 extern enum reg_class arm_regno_class (int);
 extern void arm_load_pic_register (unsigned long);
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 3e63330..7f8ab8e 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -3737,7 +3737,7 @@ arm_trampoline_adjust_address (rtx addr)
    call.  SIBLING is the call insn, so we can examine its register usage.  */
 
 int
-use_return_insn (int iscond, rtx sibling)
+use_return_insn (int iscond, rtx_insn *sibling)
 {
   int regno;
   unsigned int func_type;
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 03c1157..f8b6b95 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -907,6 +907,14 @@ is_a_helper <rtx_call_insn *>::test (rtx rt)
 template <>
 template <>
 inline bool
+is_a_helper <const rtx_call_insn *>::test (const_rtx rt)
+{
+  return CALL_P (rt);
+}
+
+template <>
+template <>
+inline bool
 is_a_helper <rtx_call_insn *>::test (rtx_insn *insn)
 {
   return CALL_P (insn);
@@ -3013,8 +3021,8 @@ extern rtx find_reg_note (const_rtx, enum reg_note, const_rtx);
 extern rtx find_regno_note (const_rtx, enum reg_note, unsigned int);
 extern rtx find_reg_equal_equiv_note (const rtx_insn *);
 extern rtx find_constant_src (const rtx_insn *);
-extern int find_reg_fusage (const_rtx, enum rtx_code, const_rtx);
-extern int find_regno_fusage (const_rtx, enum rtx_code, unsigned int);
+extern int find_reg_fusage (const rtx_insn *, enum rtx_code, const_rtx);
+extern int find_regno_fusage (const rtx_insn *, enum rtx_code, unsigned int);
 extern rtx alloc_reg_note (enum reg_note, rtx, rtx);
 extern void add_reg_note (rtx, enum reg_note, rtx);
 extern void add_int_reg_note (rtx_insn *, enum reg_note, int);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 9cd24bb..e85da56 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1196,14 +1196,17 @@ reg_set_p (const_rtx reg, const_rtx insn)
   /* We can be passed an insn or part of one.  If we are passed an insn,
      check if a side-effect of the insn clobbers REG.  */
   if (INSN_P (insn)
-      && (FIND_REG_INC_NOTE (insn, reg)
-	  || (CALL_P (insn)
-	      && ((REG_P (reg)
-		   && REGNO (reg) < FIRST_PSEUDO_REGISTER
-		   && overlaps_hard_reg_set_p (regs_invalidated_by_call,
-					       GET_MODE (reg), REGNO (reg)))
-		  || MEM_P (reg)
-		  || find_reg_fusage (insn, CLOBBER, reg)))))
+      && FIND_REG_INC_NOTE (insn, reg))
+    return true;
+
+  const rtx_call_insn *call = dyn_cast<const rtx_call_insn *> (insn);
+  if (call
+      && ((REG_P (reg)
+	   && REGNO (reg) < FIRST_PSEUDO_REGISTER
+	   && overlaps_hard_reg_set_p (regs_invalidated_by_call,
+				       GET_MODE (reg), REGNO (reg)))
+	  || MEM_P (reg)
+	  || find_reg_fusage (call, CLOBBER, reg)))
     return true;
 
   return set_of (reg, insn) != NULL_RTX;
@@ -2165,7 +2168,7 @@ find_constant_src (const rtx_insn *insn)
    in the CALL_INSN_FUNCTION_USAGE information of INSN.  */
 
 int
-find_reg_fusage (const_rtx insn, enum rtx_code code, const_rtx datum)
+find_reg_fusage (const rtx_insn *insn, enum rtx_code code, const_rtx datum)
 {
   /* If it's not a CALL_INSN, it can't possibly have a
      CALL_INSN_FUNCTION_USAGE field, so don't bother checking.  */
@@ -2210,7 +2213,7 @@ find_reg_fusage (const_rtx insn, enum rtx_code code, const_rtx datum)
    in the CALL_INSN_FUNCTION_USAGE information of INSN.  */
 
 int
-find_regno_fusage (const_rtx insn, enum rtx_code code, unsigned int regno)
+find_regno_fusage (const rtx_insn *insn, enum rtx_code code, unsigned int regno)
 {
   rtx link;
 
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 05/11] make replace_label_in_insn take labels as rtx_insn *
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (8 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 10/11] make dead_or_set_{,regno_}p take rtx_insn * tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 03/11] make find_reg_equal_equiv_note take " tbsaunde+gcc
  2016-11-14 13:45 ` [PATCH 00/11] more rtx_insn * stuff Bernd Schmidt
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* rtl.h: Adjust prototype.
	* rtlanal.c (replace_label_in_insn): Change argument type to
	rtx_insn *.
---
 gcc/rtl.h     | 2 +-
 gcc/rtlanal.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/rtl.h b/gcc/rtl.h
index dc308f2..c6c30b5 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3039,7 +3039,7 @@ extern void copy_reg_eh_region_note_backward (rtx, rtx_insn *, rtx);
 extern int inequality_comparisons_p (const_rtx);
 extern rtx replace_rtx (rtx, rtx, rtx, bool = false);
 extern void replace_label (rtx *, rtx, rtx, bool);
-extern void replace_label_in_insn (rtx_insn *, rtx, rtx, bool);
+extern void replace_label_in_insn (rtx_insn *, rtx_insn *, rtx_insn *, bool);
 extern bool rtx_referenced_p (const_rtx, const_rtx);
 extern bool tablejump_p (const rtx_insn *, rtx_insn **, rtx_jump_table_data **);
 extern int computed_jump_p (const rtx_insn *);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 7a89c03..504b265 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3079,8 +3079,8 @@ replace_label (rtx *loc, rtx old_label, rtx new_label, bool update_label_nuses)
 }
 
 void
-replace_label_in_insn (rtx_insn *insn, rtx old_label, rtx new_label,
-		       bool update_label_nuses)
+replace_label_in_insn (rtx_insn *insn, rtx_insn *old_label,
+		       rtx_insn *new_label, bool update_label_nuses)
 {
   rtx insn_as_rtx = insn;
   replace_label (&insn_as_rtx, old_label, new_label, update_label_nuses);
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 08/11] make prologue_epilogue_contains take a rtx_insn *
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (3 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 02/11] split up variables to use rtx_insn * more tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 04/11] make recog () " tbsaunde+gcc
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* function.c (contains): Change argument type to rtx_insn *.
	(prologue_contains): Likewise.
	(epilogue_contains): Likewise.
	(prologue_epilogue_contains): Likewise.
	* function.h: Adjust prototype.
---
 gcc/function.c | 12 ++++++------
 gcc/function.h |  6 +++---
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gcc/function.c b/gcc/function.c
index 0b1d168..ab76a26 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -142,7 +142,7 @@ extern tree debug_find_var_in_block_tree (tree, tree);
    can always export `prologue_epilogue_contains'.  */
 static void record_insns (rtx_insn *, rtx, hash_table<insn_cache_hasher> **)
      ATTRIBUTE_UNUSED;
-static bool contains (const_rtx, hash_table<insn_cache_hasher> *);
+static bool contains (const rtx_insn *, hash_table<insn_cache_hasher> *);
 static void prepare_function_start (void);
 static void do_clobber_return_reg (rtx, void *);
 static void do_use_return_reg (rtx, void *);
@@ -5733,7 +5733,7 @@ maybe_copy_prologue_epilogue_insn (rtx insn, rtx copy)
    we can be running after reorg, SEQUENCE rtl is possible.  */
 
 static bool
-contains (const_rtx insn, hash_table<insn_cache_hasher> *hash)
+contains (const rtx_insn *insn, hash_table<insn_cache_hasher> *hash)
 {
   if (hash == NULL)
     return false;
@@ -5748,23 +5748,23 @@ contains (const_rtx insn, hash_table<insn_cache_hasher> *hash)
       return false;
     }
 
-  return hash->find (const_cast<rtx> (insn)) != NULL;
+  return hash->find (const_cast<rtx_insn *> (insn)) != NULL;
 }
 
 int
-prologue_contains (const_rtx insn)
+prologue_contains (const rtx_insn *insn)
 {
   return contains (insn, prologue_insn_hash);
 }
 
 int
-epilogue_contains (const_rtx insn)
+epilogue_contains (const rtx_insn *insn)
 {
   return contains (insn, epilogue_insn_hash);
 }
 
 int
-prologue_epilogue_contains (const_rtx insn)
+prologue_epilogue_contains (const rtx_insn *insn)
 {
   if (contains (insn, prologue_insn_hash))
     return 1;
diff --git a/gcc/function.h b/gcc/function.h
index e854c7f..163ad0c 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -628,9 +628,9 @@ extern void clobber_return_register (void);
 extern void expand_function_end (void);
 extern rtx get_arg_pointer_save_area (void);
 extern void maybe_copy_prologue_epilogue_insn (rtx, rtx);
-extern int prologue_contains (const_rtx);
-extern int epilogue_contains (const_rtx);
-extern int prologue_epilogue_contains (const_rtx);
+extern int prologue_contains (const rtx_insn *);
+extern int epilogue_contains (const rtx_insn *);
+extern int prologue_epilogue_contains (const rtx_insn *);
 extern void record_prologue_seq (rtx_insn *);
 extern void record_epilogue_seq (rtx_insn *);
 extern void emit_return_into_block (bool simple_p, basic_block bb);
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 00/11] more rtx_insn * stuff
@ 2016-11-14  8:01 tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 09/11] make add_int_reg_note take rtx_insn * tbsaunde+gcc
                   ` (11 more replies)
  0 siblings, 12 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

Hi,

Basically $subject which gets rid of a few more casts over all.

I ment to get this out a little while back, but life got busy, and I didn't
read the status announcement properly, so virtually working from hawaii for
now. patches individually built and regtested on x86_64-linux-gnu, and series
run through config-list.mk, ok?

Thanks!

Trev

Trevor Saunders (11):
  use rtx_insn * more places where it is obvious
  split up variables to use rtx_insn * more
  make find_reg_equal_equiv_note take rtx_insn *
  make recog () take a rtx_insn *
  make replace_label_in_insn take labels as rtx_insn *
  make delete_insn () take a rtx_insn *
  remove cast from emit_libcall_block
  make prologue_epilogue_contains take a rtx_insn *
  make add_int_reg_note take rtx_insn *
  make dead_or_set_{,regno_}p take rtx_insn *
  make find_reg{,no}_fusage take rtx_insn *

 gcc/cfgrtl.c                  |  5 ++--
 gcc/cfgrtl.h                  |  2 +-
 gcc/config/aarch64/aarch64.c  |  4 +--
 gcc/config/alpha/alpha.c      |  8 +++---
 gcc/config/arc/arc.c          |  4 +--
 gcc/config/arm/arm-protos.h   |  2 +-
 gcc/config/arm/arm.c          | 24 +++++++----------
 gcc/config/c6x/c6x.c          |  5 ++--
 gcc/config/darwin.c           |  3 +--
 gcc/config/frv/frv.c          |  4 +--
 gcc/config/frv/frv.md         | 20 ++++++--------
 gcc/config/i386/i386-protos.h |  6 ++---
 gcc/config/i386/i386.c        | 14 +++++-----
 gcc/config/ia64/ia64.c        |  2 +-
 gcc/config/mcore/mcore.c      |  2 +-
 gcc/config/mn10300/mn10300.c  |  9 ++++---
 gcc/config/rs6000/rs6000.c    | 18 ++++++-------
 gcc/config/s390/s390.c        |  2 +-
 gcc/config/s390/s390.md       | 21 ++++++++++-----
 gcc/config/spu/spu.c          |  7 +++--
 gcc/config/spu/spu.md         |  6 ++---
 gcc/config/tilegx/tilegx.c    |  3 ++-
 gcc/config/v850/v850.c        |  4 +--
 gcc/cse.c                     | 63 ++++++++++++++++++++++---------------------
 gcc/expr.c                    |  4 +--
 gcc/function.c                | 12 ++++-----
 gcc/function.h                |  6 ++---
 gcc/genrecog.c                |  8 +-----
 gcc/lower-subreg.c            |  2 +-
 gcc/optabs.c                  |  5 ++--
 gcc/optabs.h                  |  2 +-
 gcc/recog.h                   |  2 +-
 gcc/rtl.h                     | 22 ++++++++++-----
 gcc/rtlanal.c                 | 35 +++++++++++++-----------
 34 files changed, 169 insertions(+), 167 deletions(-)

-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 04/11] make recog () take a rtx_insn *
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (4 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 08/11] make prologue_epilogue_contains take a rtx_insn * tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14 20:24   ` Richard Sandiford
  2016-11-14  8:01 ` [PATCH 06/11] make delete_insn " tbsaunde+gcc
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* config/v850/v850.c (expand_prologue): Adjust.
	(expand_epilogue): Likewise.
	* expr.c (init_expr_target): Likewise.
	* genrecog.c (print_subroutine): Always make the argument type
	rtx_insn *.
	* recog.h: Adjust prototype.
---
 gcc/config/v850/v850.c | 4 ++--
 gcc/expr.c             | 4 ++--
 gcc/genrecog.c         | 8 +-------
 gcc/recog.h            | 2 +-
 4 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 91e182f..c27bb6d 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -1741,7 +1741,7 @@ expand_prologue (void)
 
 	  v850_all_frame_related (save_all);
 
-	  code = recog (save_all, NULL_RTX, NULL);
+	  code = recog (save_all, NULL, NULL);
 	  if (code >= 0)
 	    {
 	      rtx insn = emit_insn (save_all);
@@ -1887,7 +1887,7 @@ expand_epilogue (void)
 	      offset -= 4;
 	    }
 
-	  code = recog (restore_all, NULL_RTX, NULL);
+	  code = recog (restore_all, NULL, NULL);
 	  
 	  if (code >= 0)
 	    {
diff --git a/gcc/expr.c b/gcc/expr.c
index 0b0946d..5d19699 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -109,7 +109,7 @@ static HOST_WIDE_INT int_expr_size (tree);
 void
 init_expr_target (void)
 {
-  rtx insn, pat;
+  rtx pat;
   machine_mode mode;
   int num_clobbers;
   rtx mem, mem1;
@@ -125,7 +125,7 @@ init_expr_target (void)
      useless RTL allocations.  */
   reg = gen_rtx_REG (word_mode, LAST_VIRTUAL_REGISTER + 1);
 
-  insn = rtx_alloc (INSN);
+  rtx_insn *insn = as_a<rtx_insn *> (rtx_alloc (INSN));
   pat = gen_rtx_SET (NULL_RTX, NULL_RTX);
   PATTERN (insn) = pat;
 
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index a8e8c22..aa7f629 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -5102,8 +5102,7 @@ print_subroutine (output_state *os, state *s, int proc_id)
   /* For now, the top-level "recog" takes a plain "rtx", and performs a
      checked cast to "rtx_insn *" for use throughout the rest of the
      function and the code it calls.  */
-  const char *insn_param
-    = proc_id > 0 ? "rtx_insn *insn" : "rtx uncast_insn";
+  const char *insn_param = "rtx_insn *insn";
   printf ("\n");
   switch (os->type)
     {
@@ -5142,11 +5141,6 @@ print_subroutine (output_state *os, state *s, int proc_id)
   if (proc_id == 0)
     {
       printf ("  recog_data.insn = NULL;\n");
-      if (os->type == RECOG)
-	{
-	  printf ("  rtx_insn *insn ATTRIBUTE_UNUSED;\n");
-	  printf ("  insn = safe_as_a <rtx_insn *> (uncast_insn);\n");
-	}
     }
   print_state (os, s, 2, true);
   printf ("}\n");
diff --git a/gcc/recog.h b/gcc/recog.h
index 3a59af8..9f6c42c 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -124,7 +124,7 @@ extern int offsettable_address_addr_space_p (int, machine_mode, rtx,
 					  ADDR_SPACE_GENERIC)
 extern bool mode_dependent_address_p (rtx, addr_space_t);
 
-extern int recog (rtx, rtx, int *);
+extern int recog (rtx, rtx_insn *, int *);
 #ifndef GENERATOR_FILE
 static inline int recog_memoized (rtx_insn *insn);
 #endif
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 10/11] make dead_or_set_{,regno_}p take rtx_insn *
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (7 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 07/11] remove cast from emit_libcall_block tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 05/11] make replace_label_in_insn take labels as " tbsaunde+gcc
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* rtl.h: Adjust prototype.
	* rtlanal.c (dead_or_set_p): Change argument type to rtx_insn *.
	(dead_or_set_regno_p): Likewise.
---
 gcc/rtl.h     | 4 ++--
 gcc/rtlanal.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/rtl.h b/gcc/rtl.h
index efb8127..03c1157 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -3007,8 +3007,8 @@ extern void find_all_hard_regs (const_rtx, HARD_REG_SET *);
 extern void find_all_hard_reg_sets (const rtx_insn *, HARD_REG_SET *, bool);
 extern void note_stores (const_rtx, void (*) (rtx, const_rtx, void *), void *);
 extern void note_uses (rtx *, void (*) (rtx *, void *), void *);
-extern int dead_or_set_p (const_rtx, const_rtx);
-extern int dead_or_set_regno_p (const_rtx, unsigned int);
+extern int dead_or_set_p (const rtx_insn *, const_rtx);
+extern int dead_or_set_regno_p (const rtx_insn *, unsigned int);
 extern rtx find_reg_note (const_rtx, enum reg_note, const_rtx);
 extern rtx find_regno_note (const_rtx, enum reg_note, unsigned int);
 extern rtx find_reg_equal_equiv_note (const rtx_insn *);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 75dde3d..9cd24bb 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1943,7 +1943,7 @@ note_uses (rtx *pbody, void (*fun) (rtx *, void *), void *data)
    by INSN.  */
 
 int
-dead_or_set_p (const_rtx insn, const_rtx x)
+dead_or_set_p (const rtx_insn *insn, const_rtx x)
 {
   unsigned int regno, end_regno;
   unsigned int i;
@@ -2017,7 +2017,7 @@ covers_regno_p (const_rtx dest, unsigned int test_regno)
 /* Utility function for dead_or_set_p to check an individual register. */
 
 int
-dead_or_set_regno_p (const_rtx insn, unsigned int test_regno)
+dead_or_set_regno_p (const rtx_insn *insn, unsigned int test_regno)
 {
   const_rtx pattern;
 
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 07/11] remove cast from emit_libcall_block
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (6 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 06/11] make delete_insn " tbsaunde+gcc
@ 2016-11-14  8:01 ` tbsaunde+gcc
  2016-11-14  8:01 ` [PATCH 10/11] make dead_or_set_{,regno_}p take rtx_insn * tbsaunde+gcc
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 17+ messages in thread
From: tbsaunde+gcc @ 2016-11-14  8:01 UTC (permalink / raw)
  To: gcc-patches

From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

gcc/ChangeLog:

2016-11-14  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* optabs.c (emit_libcall_block): Change argument type to
	rtx_insn *.
	* optabs.h: Adjust prototype.
---
 gcc/optabs.c | 5 ++---
 gcc/optabs.h | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/gcc/optabs.c b/gcc/optabs.c
index 7a1f025..2c7ca25 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -3681,10 +3681,9 @@ emit_libcall_block_1 (rtx_insn *insns, rtx target, rtx result, rtx equiv,
 }
 
 void
-emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
+emit_libcall_block (rtx_insn *insns, rtx target, rtx result, rtx equiv)
 {
-  emit_libcall_block_1 (safe_as_a <rtx_insn *> (insns),
-			target, result, equiv, false);
+  emit_libcall_block_1 (insns, target, result, equiv, false);
 }
 \f
 /* Nonzero if we can perform a comparison of mode MODE straightforwardly.
diff --git a/gcc/optabs.h b/gcc/optabs.h
index 03fd94d..9ab8cb1 100644
--- a/gcc/optabs.h
+++ b/gcc/optabs.h
@@ -224,7 +224,7 @@ extern bool maybe_emit_unop_insn (enum insn_code, rtx, rtx, enum rtx_code);
 extern void emit_unop_insn (enum insn_code, rtx, rtx, enum rtx_code);
 
 /* Emit code to make a call to a constant function or a library call.  */
-extern void emit_libcall_block (rtx, rtx, rtx, rtx);
+extern void emit_libcall_block (rtx_insn *, rtx, rtx, rtx);
 
 /* The various uses that a comparison can have; used by can_compare_p:
    jumps, conditional moves, store flag operations.  */
-- 
2.9.3.dirty

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 00/11] more rtx_insn * stuff
  2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
                   ` (10 preceding siblings ...)
  2016-11-14  8:01 ` [PATCH 03/11] make find_reg_equal_equiv_note take " tbsaunde+gcc
@ 2016-11-14 13:45 ` Bernd Schmidt
  2016-11-14 15:18   ` Trevor Saunders
  11 siblings, 1 reply; 17+ messages in thread
From: Bernd Schmidt @ 2016-11-14 13:45 UTC (permalink / raw)
  To: tbsaunde+gcc, gcc-patches

On 11/14/2016 09:09 AM, tbsaunde+gcc@tbsaunde.org wrote:
> From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
>
> Hi,
>
> Basically $subject which gets rid of a few more casts over all.
>
> I ment to get this out a little while back, but life got busy, and I didn't
> read the status announcement properly, so virtually working from hawaii for
> now. patches individually built and regtested on x86_64-linux-gnu, and series
> run through config-list.mk, ok?

Ok for all except #3 and #11.

For #3, I just don't like increasing indentation like that, I prefer to 
just declare the variable earlier.
#11 does unexplained things with dyn_casts (why not as_a?) and templates.


Bernd

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 00/11] more rtx_insn * stuff
  2016-11-14 13:45 ` [PATCH 00/11] more rtx_insn * stuff Bernd Schmidt
@ 2016-11-14 15:18   ` Trevor Saunders
  0 siblings, 0 replies; 17+ messages in thread
From: Trevor Saunders @ 2016-11-14 15:18 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: tbsaunde+gcc, gcc-patches

On Mon, Nov 14, 2016 at 02:45:40PM +0100, Bernd Schmidt wrote:
> On 11/14/2016 09:09 AM, tbsaunde+gcc@tbsaunde.org wrote:
> > From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
> > 
> > Hi,
> > 
> > Basically $subject which gets rid of a few more casts over all.
> > 
> > I ment to get this out a little while back, but life got busy, and I didn't
> > read the status announcement properly, so virtually working from hawaii for
> > now. patches individually built and regtested on x86_64-linux-gnu, and series
> > run through config-list.mk, ok?
> 
> Ok for all except #3 and #11.
> 
> For #3, I just don't like increasing indentation like that, I prefer to just
> declare the variable earlier.

ok, fine.

> #11 does unexplained things with dyn_casts (why not as_a?) and templates.

sorry, I really should have explained that.  For some reason we were
missing a is_a_helper specialization to test if a const_rtx is a
rtx_call_insn *, we have ones for things like const_rtx to const
rtx_insn *, but not const rtx_call_insn *.  So I added that which is the
template stuff.  I used dyn_cast because its the same as if (is_a<x> ())
as_a<x> (), but in this case its shorter than writing that out.  Of
course I could use is_a and as_a if that seems clearer.

Trev

> 
> Bernd

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 04/11] make recog () take a rtx_insn *
  2016-11-14  8:01 ` [PATCH 04/11] make recog () " tbsaunde+gcc
@ 2016-11-14 20:24   ` Richard Sandiford
  0 siblings, 0 replies; 17+ messages in thread
From: Richard Sandiford @ 2016-11-14 20:24 UTC (permalink / raw)
  To: tbsaunde+gcc; +Cc: gcc-patches

Thanks for doing this.

tbsaunde+gcc@tbsaunde.org writes:
> diff --git a/gcc/genrecog.c b/gcc/genrecog.c
> index a8e8c22..aa7f629 100644
> --- a/gcc/genrecog.c
> +++ b/gcc/genrecog.c
> @@ -5102,8 +5102,7 @@ print_subroutine (output_state *os, state *s, int proc_id)
>    /* For now, the top-level "recog" takes a plain "rtx", and performs a
>       checked cast to "rtx_insn *" for use throughout the rest of the
>       function and the code it calls.  */
> -  const char *insn_param
> -    = proc_id > 0 ? "rtx_insn *insn" : "rtx uncast_insn";
> +  const char *insn_param = "rtx_insn *insn";

The comment is no longer true after the patch.  We might as well just
get rid of the variable now that it's equal to a constant string of
almost the same length as the variable name.

Richard

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 01/11] use rtx_insn * more places where it is obvious
  2016-11-14  8:01 ` [PATCH 01/11] use rtx_insn * more places where it is obvious tbsaunde+gcc
@ 2016-11-22 10:10   ` Andreas Schwab
  2016-11-23 20:17     ` Jeff Law
  0 siblings, 1 reply; 17+ messages in thread
From: Andreas Schwab @ 2016-11-22 10:10 UTC (permalink / raw)
  To: tbsaunde+gcc; +Cc: gcc-patches

../../gcc/config/ia64/ia64.c:7141:13: error: 'void ia64_emit_insn_before(rtx, rtx)' declared 'static' but never defined [-Werror=unused-function]
 static void ia64_emit_insn_before (rtx, rtx);
             ^~~~~~~~~~~~~~~~~~~~~

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 01/11] use rtx_insn * more places where it is obvious
  2016-11-22 10:10   ` Andreas Schwab
@ 2016-11-23 20:17     ` Jeff Law
  0 siblings, 0 replies; 17+ messages in thread
From: Jeff Law @ 2016-11-23 20:17 UTC (permalink / raw)
  To: Andreas Schwab, tbsaunde+gcc; +Cc: gcc-patches

On 11/22/2016 03:10 AM, Andreas Schwab wrote:
> ../../gcc/config/ia64/ia64.c:7141:13: error: 'void ia64_emit_insn_before(rtx, rtx)' declared 'static' but never defined [-Werror=unused-function]
>  static void ia64_emit_insn_before (rtx, rtx);
>              ^~~~~~~~~~~~~~~~~~~~~
I fixed this and a similar instance in another port.

jeff

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-11-23 20:17 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-14  8:01 [PATCH 00/11] more rtx_insn * stuff tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 09/11] make add_int_reg_note take rtx_insn * tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 01/11] use rtx_insn * more places where it is obvious tbsaunde+gcc
2016-11-22 10:10   ` Andreas Schwab
2016-11-23 20:17     ` Jeff Law
2016-11-14  8:01 ` [PATCH 11/11] make find_reg{,no}_fusage take rtx_insn * tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 02/11] split up variables to use rtx_insn * more tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 08/11] make prologue_epilogue_contains take a rtx_insn * tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 04/11] make recog () " tbsaunde+gcc
2016-11-14 20:24   ` Richard Sandiford
2016-11-14  8:01 ` [PATCH 06/11] make delete_insn " tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 07/11] remove cast from emit_libcall_block tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 10/11] make dead_or_set_{,regno_}p take rtx_insn * tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 05/11] make replace_label_in_insn take labels as " tbsaunde+gcc
2016-11-14  8:01 ` [PATCH 03/11] make find_reg_equal_equiv_note take " tbsaunde+gcc
2016-11-14 13:45 ` [PATCH 00/11] more rtx_insn * stuff Bernd Schmidt
2016-11-14 15:18   ` Trevor Saunders

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).