From ea28c35ae759f1360193980f6dc9e6a628c3189c Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Tue, 8 Jul 2014 11:12:00 -0400
Subject: [PATCH 155/236] config/xtensa: Use rtx_insn and rtx_code_label

gcc/
	* config/xtensa/xtensa-protos.h (xtensa_emit_loop_end): Strengthen
	first param from rtx to rtx_insn *.
	* config/xtensa/xtensa.c (struct machine_function): Likewise for
	field "set_frame_ptr_insn".
	(xtensa_expand_compare_and_swap): Strengthen locals "csloop" and
	"csend" from rtx to rtx_code_label *.
	(xtensa_expand_atomic): Likewise for local "csloop".
	(xtensa_emit_loop_end): Strengthen param "insn" from rtx to
	rtx_insn *.
	(xtensa_call_tls_desc): Likewise for return type and locals
	"call_insn", "insns".
	(xtensa_legitimize_tls_address): Likewise for local "insns".
	(xtensa_expand_prologue): Likewise for locals "insn", "first".
---
 gcc/config/xtensa/xtensa-protos.h |  2 +-
 gcc/config/xtensa/xtensa.c        | 23 +++++++++++++----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h
index 5f09026..e684af8 100644
--- a/gcc/config/xtensa/xtensa-protos.h
+++ b/gcc/config/xtensa/xtensa-protos.h
@@ -47,7 +47,7 @@ extern rtx xtensa_copy_incoming_a7 (rtx);
 extern void xtensa_expand_nonlocal_goto (rtx *);
 extern void xtensa_expand_compare_and_swap (rtx, rtx, rtx, rtx);
 extern void xtensa_expand_atomic (enum rtx_code, rtx, rtx, rtx, bool);
-extern void xtensa_emit_loop_end (rtx, rtx *);
+extern void xtensa_emit_loop_end (rtx_insn *, rtx *);
 extern char *xtensa_emit_branch (bool, bool, rtx *);
 extern char *xtensa_emit_bit_branch (bool, bool, rtx *);
 extern char *xtensa_emit_movcc (bool, bool, bool, rtx *);
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 6b6693f..93fd895 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -99,7 +99,7 @@ struct GTY(()) machine_function
   bool need_a7_copy;
   bool vararg_a7;
   rtx vararg_a7_copy;
-  rtx set_frame_ptr_insn;
+  rtx_insn *set_frame_ptr_insn;
 };
 
 /* Vector, indexed by hard register number, which contains 1 for a
@@ -1463,8 +1463,8 @@ xtensa_expand_compare_and_swap (rtx target, rtx mem, rtx cmp, rtx new_rtx)
   rtx tmp, cmpv, newv, val;
   rtx oldval = gen_reg_rtx (SImode);
   rtx res = gen_reg_rtx (SImode);
-  rtx csloop = gen_label_rtx ();
-  rtx csend = gen_label_rtx ();
+  rtx_code_label *csloop = gen_label_rtx ();
+  rtx_code_label *csend = gen_label_rtx ();
 
   init_alignment_context (&ac, mem);
 
@@ -1524,7 +1524,7 @@ xtensa_expand_atomic (enum rtx_code code, rtx target, rtx mem, rtx val,
 {
   enum machine_mode mode = GET_MODE (mem);
   struct alignment_context ac;
-  rtx csloop = gen_label_rtx ();
+  rtx_code_label *csloop = gen_label_rtx ();
   rtx cmp, tmp;
   rtx old = gen_reg_rtx (SImode);
   rtx new_rtx = gen_reg_rtx (SImode);
@@ -1642,7 +1642,7 @@ xtensa_setup_frame_addresses (void)
    when the branch is taken.  */
 
 void
-xtensa_emit_loop_end (rtx insn, rtx *operands)
+xtensa_emit_loop_end (rtx_insn *insn, rtx *operands)
 {
   char done = 0;
 
@@ -1862,10 +1862,11 @@ xtensa_tls_module_base (void)
 }
 
 
-static rtx
+static rtx_insn *
 xtensa_call_tls_desc (rtx sym, rtx *retp)
 {
-  rtx fn, arg, a10, call_insn, insns;
+  rtx fn, arg, a10;
+  rtx_insn *call_insn, *insns;
 
   start_sequence ();
   fn = gen_reg_rtx (Pmode);
@@ -1889,7 +1890,8 @@ static rtx
 xtensa_legitimize_tls_address (rtx x)
 {
   unsigned int model = SYMBOL_REF_TLS_MODEL (x);
-  rtx dest, tp, ret, modbase, base, addend, insns;
+  rtx dest, tp, ret, modbase, base, addend;
+  rtx_insn *insns;
 
   dest = gen_reg_rtx (Pmode);
   switch (model)
@@ -2648,7 +2650,8 @@ xtensa_expand_prologue (void)
 {
   HOST_WIDE_INT total_size;
   rtx size_rtx;
-  rtx insn, note_rtx;
+  rtx_insn *insn;
+  rtx note_rtx;
 
   total_size = compute_frame_size (get_frame_size ());
   size_rtx = GEN_INT (total_size);
@@ -2669,7 +2672,7 @@ xtensa_expand_prologue (void)
     {
       if (cfun->machine->set_frame_ptr_insn)
 	{
-	  rtx first;
+	  rtx_insn *first;
 
 	  push_topmost_sequence ();
 	  first = get_insns ();
-- 
1.8.5.3

