From 5dae9309c5097460d84ff7382615f16052e9b116 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 1 Jul 2014 06:50:47 -0400
Subject: [PATCH 150/236] config/sparc: Use rtx_insn

gcc/
	* config/sparc/sparc-protos.h (output_ubranch): Strengthen param 2
	from rtx to rtx_insn *.
	(output_cbranch): Likewise for param 6.
	(output_return): Likewise for param 1.
	(output_sibcall): Likewise.
	(output_v8plus_shift): Likewise.
	(output_v8plus_mult): Likewise.
	(output_v9branch): Likewise for param 7.
	(output_cbcond):  Likewise for param 3.

	* config/sparc/sparc.c (sparc_legitimize_tls_address): Likewise
	for local "insn".
	(sparc_legitimize_pic_address): Likewise.
	(sparc_emit_call_insn): Likewise.
	(emit_save_or_restore_regs): Likewise.
	(emit_window_save): Likewise for return type and local "insn".
	(sparc_expand_prologue): Likewise for local "insn".
	(sparc_flat_expand_prologue): Likewise.
	(output_return): Likewise for param "insn".
	(output_sibcall): Likewise for param "insn" and local "delay".
	(output_ubranch): Likewise for param "insn".
	(output_cbranch): Likewise.
	(output_cbcond): Likewise.
	(output_v9branch): Likewise.
	(output_v8plus_shift): Likewise.
	(sparc_output_mi_thunk): Likewise for local "insn".
	(get_some_local_dynamic_name): Likewise.
	(output_v8plus_mult): Likewise for param "insn".
---
 gcc/config/sparc/sparc-protos.h | 16 ++++++++--------
 gcc/config/sparc/sparc.c        | 41 ++++++++++++++++++++++-------------------
 2 files changed, 30 insertions(+), 27 deletions(-)

diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index ee2091b..c6b9802 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -69,15 +69,15 @@ extern bool sparc_expand_move (enum machine_mode, rtx *);
 extern void sparc_emit_set_symbolic_const64 (rtx, rtx, rtx);
 extern int sparc_splitdi_legitimate (rtx, rtx);
 extern int sparc_split_regreg_legitimate (rtx, rtx);
-extern const char *output_ubranch (rtx, rtx);
-extern const char *output_cbranch (rtx, rtx, int, int, int, rtx);
-extern const char *output_return (rtx);
-extern const char *output_sibcall (rtx, rtx);
-extern const char *output_v8plus_shift (rtx, rtx *, const char *);
-extern const char *output_v8plus_mult (rtx, rtx *, const char *);
-extern const char *output_v9branch (rtx, rtx, int, int, int, int, rtx);
+extern const char *output_ubranch (rtx, rtx_insn *);
+extern const char *output_cbranch (rtx, rtx, int, int, int, rtx_insn *);
+extern const char *output_return (rtx_insn *);
+extern const char *output_sibcall (rtx_insn *, rtx);
+extern const char *output_v8plus_shift (rtx_insn *, rtx *, const char *);
+extern const char *output_v8plus_mult (rtx_insn *, rtx *, const char *);
+extern const char *output_v9branch (rtx, rtx, int, int, int, int, rtx_insn *);
 extern const char *output_probe_stack_range (rtx, rtx);
-extern const char *output_cbcond (rtx, rtx, rtx);
+extern const char *output_cbcond (rtx, rtx, rtx_insn *);
 extern bool emit_scc_insn (rtx []);
 extern void emit_conditional_branch_insn (rtx []);
 extern int registers_ok_for_ldd_peep (rtx, rtx);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 7bfd3c1..7c2e57f 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -4104,7 +4104,8 @@ sparc_tls_referenced_p (rtx x)
 static rtx
 sparc_legitimize_tls_address (rtx addr)
 {
-  rtx temp1, temp2, temp3, ret, o0, got, insn;
+  rtx temp1, temp2, temp3, ret, o0, got;
+  rtx_insn *insn;
 
   gcc_assert (can_create_pseudo_p ());
 
@@ -4257,7 +4258,7 @@ sparc_legitimize_pic_address (rtx orig, rtx reg)
       || (GET_CODE (orig) == LABEL_REF && !can_use_mov_pic_label_ref (orig)))
     {
       rtx pic_ref, address;
-      rtx insn;
+      rtx_insn *insn;
 
       if (reg == 0)
 	{
@@ -4601,7 +4602,7 @@ load_got_register (void)
 void
 sparc_emit_call_insn (rtx pat, rtx addr)
 {
-  rtx insn;
+  rtx_insn *insn;
 
   insn = emit_call_insn (pat);
 
@@ -5248,7 +5249,8 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
 			   sorr_act_t action_true, sorr_act_t action_false)
 {
   unsigned int i;
-  rtx mem, insn;
+  rtx mem;
+  rtx_insn *insn;
 
   if (TARGET_ARCH64 && high <= 32)
     {
@@ -5407,10 +5409,10 @@ emit_save_or_restore_local_in_regs (rtx base, int offset, sorr_act_t action)
 
 /* Emit a window_save insn.  */
 
-static rtx
+static rtx_insn *
 emit_window_save (rtx increment)
 {
-  rtx insn = emit_insn (gen_window_save (increment));
+  rtx_insn *insn = emit_insn (gen_window_save (increment));
   RTX_FRAME_RELATED_P (insn) = 1;
 
   /* The incoming return address (%o7) is saved in %i7.  */
@@ -5451,7 +5453,7 @@ void
 sparc_expand_prologue (void)
 {
   HOST_WIDE_INT size;
-  rtx insn;
+  rtx_insn *insn;
 
   /* Compute a snapshot of crtl->uses_only_leaf_regs.  Relying
      on the final value of the flag means deferring the prologue/epilogue
@@ -5585,7 +5587,7 @@ void
 sparc_flat_expand_prologue (void)
 {
   HOST_WIDE_INT size;
-  rtx insn;
+  rtx_insn *insn;
 
   sparc_leaf_function_p = optimize > 0 && crtl->is_leaf;
 
@@ -5893,7 +5895,7 @@ output_restore (rtx pat)
 /* Output a return.  */
 
 const char *
-output_return (rtx insn)
+output_return (rtx_insn *insn)
 {
   if (crtl->calls_eh_return)
     {
@@ -5980,7 +5982,7 @@ output_return (rtx insn)
 /* Output a sibling call.  */
 
 const char *
-output_sibcall (rtx insn, rtx call_operand)
+output_sibcall (rtx_insn *insn, rtx call_operand)
 {
   rtx operands[1];
 
@@ -6015,7 +6017,7 @@ output_sibcall (rtx insn, rtx call_operand)
 
       if (final_sequence)
 	{
-	  rtx delay = NEXT_INSN (insn);
+	  rtx_insn *delay = NEXT_INSN (insn);
 	  gcc_assert (delay);
 
 	  output_restore (PATTERN (delay));
@@ -7587,7 +7589,7 @@ sparc_preferred_simd_mode (enum machine_mode mode)
    DEST is the destination insn (i.e. the label), INSN is the source.  */
 
 const char *
-output_ubranch (rtx dest, rtx insn)
+output_ubranch (rtx dest, rtx_insn *insn)
 {
   static char string[64];
   bool v9_form = false;
@@ -7661,7 +7663,7 @@ output_ubranch (rtx dest, rtx insn)
 
 const char *
 output_cbranch (rtx op, rtx dest, int label, int reversed, int annul,
-		rtx insn)
+		rtx_insn *insn)
 {
   static char string[64];
   enum rtx_code code = GET_CODE (op);
@@ -8124,7 +8126,7 @@ sparc_emit_fixunsdi (rtx *operands, enum machine_mode mode)
    and OP is the conditional expression.  */
 
 const char *
-output_cbcond (rtx op, rtx dest, rtx insn)
+output_cbcond (rtx op, rtx dest, rtx_insn *insn)
 {
   enum machine_mode mode = GET_MODE (XEXP (op, 0));
   enum rtx_code code = GET_CODE (op);
@@ -8251,7 +8253,7 @@ output_cbcond (rtx op, rtx dest, rtx insn)
 
 const char *
 output_v9branch (rtx op, rtx dest, int reg, int label, int reversed,
-		 int annul, rtx insn)
+		 int annul, rtx_insn *insn)
 {
   static char string[64];
   enum rtx_code code = GET_CODE (op);
@@ -9838,7 +9840,7 @@ sparc_check_64 (rtx x, rtx insn)
    OPERANDS are its operands and OPCODE is the mnemonic to be used.  */
 
 const char *
-output_v8plus_shift (rtx insn, rtx *operands, const char *opcode)
+output_v8plus_shift (rtx_insn *insn, rtx *operands, const char *opcode)
 {
   static char asm_code[60];
 
@@ -11265,7 +11267,8 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
 		       HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset,
 		       tree function)
 {
-  rtx this_rtx, insn, funexp;
+  rtx this_rtx, funexp;
+  rtx_insn *insn;
   unsigned int int_arg_first;
 
   reload_completed = 1;
@@ -11487,7 +11490,7 @@ sparc_init_machine_status (void)
 static const char *
 get_some_local_dynamic_name (void)
 {
-  rtx insn;
+  rtx_insn *insn;
 
   if (cfun->machine->some_ld_name)
     return cfun->machine->some_ld_name;
@@ -12121,7 +12124,7 @@ sparc_preferred_reload_class (rtx x, reg_class_t rclass)
    OPERANDS are its operands and OPCODE is the mnemonic to be used.  */
 
 const char *
-output_v8plus_mult (rtx insn, rtx *operands, const char *opcode)
+output_v8plus_mult (rtx_insn *insn, rtx *operands, const char *opcode)
 {
   char mulstr[32];
 
-- 
1.8.5.3

