From 35378b7059d70f37f5557a11777f1bb7ed12fad5 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Fri, 30 May 2014 16:15:43 -0400
Subject: [PATCH 13/24] cfgexpand.c: strengthen various rtx locals

gcc/
	* cfgexpand.c (maybe_dump_rtl_for_gimple_stmt): Strengthen param
	"since" from rtx to rtx_insn *.
	(maybe_cleanup_end_of_block): Likewise for param "last" and local
	"insn".
	(expand_gimple_cond): Likewise for locals "last2" and "last".
	(mark_transaction_restart_calls): Likewise for local "insn".
	(expand_gimple_stmt): Likewise for return type and locals "last"
	and "insn".
	(expand_gimple_tailcall): Likewise for locals "last2" and "last".
	(avoid_complex_debug_insns): Likewise for param "insn".
	(expand_debug_locations): Likewise for locals "insn", "last",
	"prev_insn" and "insn2".
	(expand_gimple_basic_block): Likewise for local "last".
---
 gcc/cfgexpand.c | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index df52c08..4fb8264 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1941,7 +1941,7 @@ expand_used_vars (void)
    generated for STMT should have been appended.  */
 
 static void
-maybe_dump_rtl_for_gimple_stmt (gimple stmt, rtx since)
+maybe_dump_rtl_for_gimple_stmt (gimple stmt, rtx_insn *since)
 {
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
@@ -2002,7 +2002,7 @@ label_rtx_for_bb (basic_block bb ATTRIBUTE_UNUSED)
    last instruction before the just emitted jump sequence.  */
 
 static void
-maybe_cleanup_end_of_block (edge e, rtx last)
+maybe_cleanup_end_of_block (edge e, rtx_insn *last)
 {
   /* Special case: when jumpif decides that the condition is
      trivial it emits an unconditional jump (and the necessary
@@ -2017,7 +2017,7 @@ maybe_cleanup_end_of_block (edge e, rtx last)
      normally isn't there in a cleaned CFG), fix it here.  */
   if (BARRIER_P (get_last_insn ()))
     {
-      rtx insn;
+      rtx_insn *insn;
       remove_edge (e);
       /* Now, we have a single successor block, if we have insns to
 	 insert on the remaining edge we potentially will insert
@@ -2059,7 +2059,7 @@ expand_gimple_cond (basic_block bb, gimple stmt)
   edge new_edge;
   edge true_edge;
   edge false_edge;
-  rtx last2, last;
+  rtx_insn *last2, *last;
   enum tree_code code;
   tree op0, op1;
 
@@ -2206,7 +2206,7 @@ mark_transaction_restart_calls (gimple stmt)
     {
       struct tm_restart_node *n = (struct tm_restart_node *) *slot;
       tree list = n->label_or_list;
-      rtx insn;
+      rtx_insn *insn;
 
       for (insn = next_real_insn (get_last_insn ());
 	   !CALL_P (insn);
@@ -3335,11 +3335,11 @@ expand_gimple_stmt_1 (gimple stmt)
    sets REG_EH_REGION notes if necessary and sets the current source
    location for diagnostics.  */
 
-static rtx
+static rtx_insn *
 expand_gimple_stmt (gimple stmt)
 {
   location_t saved_location = input_location;
-  rtx last = get_last_insn ();
+  rtx_insn *last = get_last_insn ();
   int lp_nr;
 
   gcc_assert (cfun);
@@ -3362,7 +3362,7 @@ expand_gimple_stmt (gimple stmt)
   lp_nr = lookup_stmt_eh_lp (stmt);
   if (lp_nr)
     {
-      rtx insn;
+      rtx_insn *insn;
       for (insn = next_real_insn (last); insn;
 	   insn = next_real_insn (insn))
 	{
@@ -3392,7 +3392,7 @@ expand_gimple_stmt (gimple stmt)
 static basic_block
 expand_gimple_tailcall (basic_block bb, gimple stmt, bool *can_fallthru)
 {
-  rtx last2, last;
+  rtx_insn *last2, *last;
   edge e;
   edge_iterator ei;
   int probability;
@@ -4767,7 +4767,7 @@ expand_debug_source_expr (tree exp)
    deeper than that, create DEBUG_EXPRs and emit DEBUG_INSNs before INSN.  */
 
 static void
-avoid_complex_debug_insns (rtx insn, rtx *exp_p, int depth)
+avoid_complex_debug_insns (rtx_insn *insn, rtx *exp_p, int depth)
 {
   rtx exp = *exp_p;
 
@@ -4819,8 +4819,8 @@ avoid_complex_debug_insns (rtx insn, rtx *exp_p, int depth)
 static void
 expand_debug_locations (void)
 {
-  rtx insn;
-  rtx last = get_last_insn ();
+  rtx_insn *insn;
+  rtx_insn *last = get_last_insn ();
   int save_strict_alias = flag_strict_aliasing;
 
   /* New alias sets while setting up memory attributes cause
@@ -4832,7 +4832,8 @@ expand_debug_locations (void)
     if (DEBUG_INSN_P (insn))
       {
 	tree value = (tree)INSN_VAR_LOCATION_LOC (insn);
-	rtx val, prev_insn, insn2;
+	rtx val;
+	rtx_insn *prev_insn, *insn2;
 	enum machine_mode mode;
 
 	if (value == NULL_TREE)
@@ -4877,7 +4878,8 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
   gimple_stmt_iterator gsi;
   gimple_seq stmts;
   gimple stmt = NULL;
-  rtx note, last;
+  rtx note;
+  rtx_insn *last;
   edge e;
   edge_iterator ei;
   rtx *elt;
-- 
1.8.5.3

