From 72352fa68feb17b55b6936a8eed08036cd311aca Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 8 Jul 2014 09:48:31 -0400
Subject: [PATCH 137/236] config/iq2000: Use rtx_insn

gcc/
	* config/iq2000/iq2000-protos.h (final_prescan_insn): Strengthen
	first param from rtx to rtx_insn *.
	(iq2000_adjust_insn_length): Likewise.
	(iq2000_output_conditional_branch): Likewise.
	* config/iq2000/iq2000.c (final_prescan_insn): Likewise for param
	"insn" and local "nop_insn".
	(iq2000_annotate_frame_insn): Likewise for param "insn".
	(iq2000_expand_prologue): Likewise for both locals "insn".
	(iq2000_adjust_insn_length): Likewise for param "insn".
	(iq2000_output_conditional_branch): Likewise.
---
 gcc/config/iq2000/iq2000-protos.h |  7 ++++---
 gcc/config/iq2000/iq2000.c        | 18 ++++++++++--------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/gcc/config/iq2000/iq2000-protos.h b/gcc/config/iq2000/iq2000-protos.h
index 6be8da9..17adef6 100644
--- a/gcc/config/iq2000/iq2000-protos.h
+++ b/gcc/config/iq2000/iq2000-protos.h
@@ -25,15 +25,16 @@ extern int              iq2000_reg_mode_ok_for_base_p (rtx, enum machine_mode, i
 extern const char *     iq2000_fill_delay_slot (const char *, enum delay_type, rtx *, rtx);
 extern const char *     iq2000_move_1word (rtx *, rtx, int);
 extern HOST_WIDE_INT    iq2000_debugger_offset (rtx, HOST_WIDE_INT);
-extern void             final_prescan_insn (rtx, rtx *, int);
+extern void             final_prescan_insn (rtx_insn *, rtx *, int);
 extern HOST_WIDE_INT    compute_frame_size (HOST_WIDE_INT);
 extern int              iq2000_initial_elimination_offset (int, int);
 extern void             iq2000_expand_prologue (void);
 extern void             iq2000_expand_epilogue (void);
 extern void             iq2000_expand_eh_return (rtx);
 extern int              iq2000_can_use_return_insn (void);
-extern int              iq2000_adjust_insn_length (rtx, int);
-extern char *           iq2000_output_conditional_branch (rtx, rtx *, int, int, int, int);
+extern int              iq2000_adjust_insn_length (rtx_insn *, int);
+extern char *           iq2000_output_conditional_branch (rtx_insn *, rtx *,
+							  int, int, int, int);
 
 #ifdef RTX_CODE
 extern rtx              gen_int_relational (enum rtx_code, rtx, rtx, rtx, int *);
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index 717df2e..9e7fecd 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -1506,7 +1506,7 @@ iq2000_debugger_offset (rtx addr, HOST_WIDE_INT offset)
    of load delays, and also to update the delay slot statistics.  */
 
 void
-final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED,
+final_prescan_insn (rtx_insn *insn, rtx opvec[] ATTRIBUTE_UNUSED,
 		    int noperands ATTRIBUTE_UNUSED)
 {
   if (dslots_number_nops > 0)
@@ -1540,7 +1540,7 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED,
        || (GET_CODE (PATTERN (insn)) == RETURN))
 	   && NEXT_INSN (PREV_INSN (insn)) == insn)
     {
-      rtx nop_insn = emit_insn_after (gen_nop (), insn);
+      rtx_insn *nop_insn = emit_insn_after (gen_nop (), insn);
 
       INSN_ADDRESSES_NEW (nop_insn, -1);
     }
@@ -1772,7 +1772,7 @@ iq2000_add_large_offset_to_sp (HOST_WIDE_INT offset)
    operation DWARF_PATTERN.  */
 
 static void
-iq2000_annotate_frame_insn (rtx insn, rtx dwarf_pattern)
+iq2000_annotate_frame_insn (rtx_insn *insn, rtx dwarf_pattern)
 {
   RTX_FRAME_RELATED_P (insn) = 1;
   REG_NOTES (insn) = alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR,
@@ -2020,7 +2020,8 @@ iq2000_expand_prologue (void)
   if (tsize > 0)
     {
       rtx tsize_rtx = GEN_INT (tsize);
-      rtx adjustment_rtx, insn, dwarf_pattern;
+      rtx adjustment_rtx, dwarf_pattern;
+      rtx_insn *insn;
 
       if (tsize > 32767)
 	{
@@ -2043,7 +2044,7 @@ iq2000_expand_prologue (void)
 
       if (frame_pointer_needed)
 	{
-	  rtx insn = 0;
+	  rtx_insn *insn = 0;
 
 	  insn = emit_insn (gen_movsi (hard_frame_pointer_rtx,
 				       stack_pointer_rtx));
@@ -2282,7 +2283,7 @@ iq2000_pass_by_reference (cumulative_args_t cum_v, enum machine_mode mode,
    attributes in the machine-description file.  */
 
 int
-iq2000_adjust_insn_length (rtx insn, int length)
+iq2000_adjust_insn_length (rtx_insn *insn, int length)
 {
   /* A unconditional jump has an unfilled delay slot if it is not part
      of a sequence.  A conditional jump normally has a delay slot.  */
@@ -2310,8 +2311,9 @@ iq2000_adjust_insn_length (rtx insn, int length)
    reversed conditional branch around a `jr' instruction.  */
 
 char *
-iq2000_output_conditional_branch (rtx insn, rtx * operands, int two_operands_p,
-				  int float_p, int inverted_p, int length)
+iq2000_output_conditional_branch (rtx_insn *insn, rtx * operands,
+				  int two_operands_p, int float_p,
+				  int inverted_p, int length)
 {
   static char buffer[200];
   /* The kind of comparison we are doing.  */
-- 
1.8.5.3

