[committed] Tighten some rtx-based variable and return types
diff mbox

Message ID 87bngtrn9k.fsf@googlemail.com
State New
Headers show

Commit Message

Richard Sandiford June 6, 2015, 1:15 p.m. UTC
These are the main rtx-related changes found by the -Wupcast-* warnings
that I posted last week.

Bootstrapped & regression-tested on x86_64-linux-gnu.  Also tested on
config-list.mk, checking that all build failures were unrelated.
Applied as obvious.

Thanks,
Richard


gcc/
	* emit-rtl.c, expr.c, gcse.c, optabs.c, optabs.h, print-rtl.c,
	rtl.h, bb-reorder.c, builtins.c, calls.c, cfgbuild.c, cfgexpand.c,
	cfgrtl.c, cilk-common.c, config/i386/i386.md, cse.c, dwarf2cfi.c,
	except.c, final.c, function.c, gcse-common.c, genemit.c,
	haifa-sched.c, ifcvt.c, jump.c, loop-invariant.c, loop-iv.c,
	lra-constraints.c, lra.c, reload1.c, resource.c, rtlanal.c,
	sched-deps.c, sched-ebb.c, sel-sched-ir.c, sel-sched.c,
	shrink-wrap.c, stmt.c, store-motion.c: Replace rtx base types with
	more derived ones.

Patch
diff mbox

Index: gcc/emit-rtl.c
===================================================================
--- gcc/emit-rtl.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/emit-rtl.c	2015-06-06 11:33:59.756667734 +0100
@@ -3662,7 +3662,7 @@  try_split (rtx pat, rtx_insn *trial, int
   int probability;
   rtx_insn *insn_last, *insn;
   int njumps = 0;
-  rtx call_insn = NULL_RTX;
+  rtx_insn *call_insn = NULL;
 
   /* We're not good at redistributing frame information.  */
   if (RTX_FRAME_RELATED_P (trial))
@@ -4684,10 +4684,10 @@  emit_pattern_after_setloc (rtx pattern,
 			   rtx_insn *(*make_raw) (rtx))
 {
   rtx_insn *after = safe_as_a <rtx_insn *> (uncast_after);
-  rtx last = emit_pattern_after_noloc (pattern, after, NULL, make_raw);
+  rtx_insn *last = emit_pattern_after_noloc (pattern, after, NULL, make_raw);
 
   if (pattern == NULL_RTX || !loc)
-    return safe_as_a <rtx_insn *> (last);
+    return last;
 
   after = NEXT_INSN (after);
   while (1)
@@ -4700,7 +4700,7 @@  emit_pattern_after_setloc (rtx pattern,
 	break;
       after = NEXT_INSN (after);
     }
-  return safe_as_a <rtx_insn *> (last);
+  return last;
 }
 
 /* Insert PATTERN after AFTER.  MAKE_RAW indicates how to turn PATTERN
Index: gcc/expr.c
===================================================================
--- gcc/expr.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/expr.c	2015-06-06 11:33:59.760667688 +0100
@@ -10559,7 +10559,7 @@  expand_expr_real_1 (tree exp, rtx target
 	      if ((icode = optab_handler (movmisalign_optab, mode))
 		  != CODE_FOR_nothing)
 		{
-		  rtx reg, insn;
+		  rtx reg;
 
 		  op0 = adjust_address (op0, mode, 0);
 		  /* We've already validated the memory, and we're creating a
@@ -10568,7 +10568,7 @@  expand_expr_real_1 (tree exp, rtx target
 		  reg = gen_reg_rtx (mode);
 
 		  /* Nor can the insn generator.  */
-		  insn = GEN_FCN (icode) (reg, op0);
+		  rtx_insn *insn = GEN_FCN (icode) (reg, op0);
 		  emit_insn (insn);
 		  return reg;
 		}
Index: gcc/gcse.c
===================================================================
--- gcc/gcse.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/gcse.c	2015-06-06 11:33:59.760667688 +0100
@@ -540,7 +540,6 @@  static void trim_ld_motion_mems (void);
 static void update_ld_motion_stores (struct gcse_expr *);
 static void clear_modify_mem_tables (void);
 static void free_modify_mem_tables (void);
-static rtx gcse_emit_move_after (rtx, rtx, rtx_insn *);
 static bool is_too_expensive (const char *);
 
 #define GNEW(T)			((T *) gmalloc (sizeof (T)))
@@ -2434,7 +2433,7 @@  single_set_gcse (rtx_insn *insn)
 /* Emit move from SRC to DEST noting the equivalence with expression computed
    in INSN.  */
 
-static rtx
+static rtx_insn *
 gcse_emit_move_after (rtx dest, rtx src, rtx_insn *insn)
 {
   rtx_insn *new_rtx;
@@ -3960,7 +3959,6 @@  update_ld_motion_stores (struct gcse_exp
 	  rtx pat = PATTERN (insn);
 	  rtx src = SET_SRC (pat);
 	  rtx reg = expr->reaching_reg;
-	  rtx copy;
 
 	  /* If we've already copied it, continue.  */
 	  if (expr->reaching_reg == src)
@@ -3975,7 +3973,7 @@  update_ld_motion_stores (struct gcse_exp
 	      fprintf (dump_file, "\n");
 	    }
 
-	  copy = gen_move_insn (reg, copy_rtx (SET_SRC (pat)));
+	  rtx_insn *copy = gen_move_insn (reg, copy_rtx (SET_SRC (pat)));
 	  emit_insn_before (copy, insn);
 	  SET_SRC (pat) = reg;
 	  df_insn_rescan (insn);
Index: gcc/optabs.c
===================================================================
--- gcc/optabs.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/optabs.c	2015-06-06 11:33:59.764667641 +0100
@@ -2048,7 +2048,7 @@  expand_binop (machine_mode mode, optab b
 	  if (optab_handler (mov_optab, mode) != CODE_FOR_nothing
 	      || ! rtx_equal_p (target, xtarget))
 	    {
-	      rtx temp = emit_move_insn (target, xtarget);
+	      rtx_insn *temp = emit_move_insn (target, xtarget);
 
 	      set_dst_reg_note (temp, REG_EQUAL,
 				gen_rtx_fmt_ee (optab_to_code (binoptab),
@@ -4720,7 +4720,7 @@  emit_conditional_add (rtx target, enum r
 
 /* Generate and return an insn body to add Y to X.  */
 
-rtx
+rtx_insn *
 gen_add2_insn (rtx x, rtx y)
 {
   enum insn_code icode = optab_handler (add_optab, GET_MODE (x));
@@ -4735,7 +4735,7 @@  gen_add2_insn (rtx x, rtx y)
 /* Generate and return an insn body to add r1 and c,
    storing the result in r0.  */
 
-rtx
+rtx_insn *
 gen_add3_insn (rtx r0, rtx r1, rtx c)
 {
   enum insn_code icode = optab_handler (add_optab, GET_MODE (r0));
@@ -4744,7 +4744,7 @@  gen_add3_insn (rtx r0, rtx r1, rtx c)
       || !insn_operand_matches (icode, 0, r0)
       || !insn_operand_matches (icode, 1, r1)
       || !insn_operand_matches (icode, 2, c))
-    return NULL_RTX;
+    return NULL;
 
   return GEN_FCN (icode) (r0, r1, c);
 }
@@ -4771,7 +4771,7 @@  have_add2_insn (rtx x, rtx y)
 
 /* Generate and return an insn body to add Y to X.  */
 
-rtx
+rtx_insn *
 gen_addptr3_insn (rtx x, rtx y, rtx z)
 {
   enum insn_code icode = optab_handler (addptr3_optab, GET_MODE (x));
@@ -4808,7 +4808,7 @@  have_addptr3_insn (rtx x, rtx y, rtx z)
 
 /* Generate and return an insn body to subtract Y from X.  */
 
-rtx
+rtx_insn *
 gen_sub2_insn (rtx x, rtx y)
 {
   enum insn_code icode = optab_handler (sub_optab, GET_MODE (x));
@@ -4823,7 +4823,7 @@  gen_sub2_insn (rtx x, rtx y)
 /* Generate and return an insn body to subtract r1 and c,
    storing the result in r0.  */
 
-rtx
+rtx_insn *
 gen_sub3_insn (rtx r0, rtx r1, rtx c)
 {
   enum insn_code icode = optab_handler (sub_optab, GET_MODE (r0));
@@ -4832,7 +4832,7 @@  gen_sub3_insn (rtx r0, rtx r1, rtx c)
       || !insn_operand_matches (icode, 0, r0)
       || !insn_operand_matches (icode, 1, r1)
       || !insn_operand_matches (icode, 2, c))
-    return NULL_RTX;
+    return NULL;
 
   return GEN_FCN (icode) (r0, r1, c);
 }
@@ -4878,7 +4878,7 @@  can_extend_p (machine_mode to_mode, mach
 /* Generate the body of an insn to extend Y (with mode MFROM)
    into X (with mode MTO).  Do zero-extension if UNSIGNEDP is nonzero.  */
 
-rtx
+rtx_insn *
 gen_extend_insn (rtx x, rtx y, machine_mode mto,
 		 machine_mode mfrom, int unsignedp)
 {
@@ -6395,12 +6395,12 @@  debug_optab_libfuncs (void)
 /* Generate insns to trap with code TCODE if OP1 and OP2 satisfy condition
    CODE.  Return 0 on failure.  */
 
-rtx
+rtx_insn *
 gen_cond_trap (enum rtx_code code, rtx op1, rtx op2, rtx tcode)
 {
   machine_mode mode = GET_MODE (op1);
   enum insn_code icode;
-  rtx insn;
+  rtx_insn *insn;
   rtx trap_rtx;
 
   if (mode == VOIDmode)
@@ -6419,7 +6419,7 @@  gen_cond_trap (enum rtx_code code, rtx o
   prepare_cmp_insn (op1, op2, code, NULL_RTX, false, OPTAB_DIRECT,
 		    &trap_rtx, &mode);
   if (!trap_rtx)
-    insn = NULL_RTX;
+    insn = NULL;
   else
     insn = GEN_FCN (icode) (trap_rtx, XEXP (trap_rtx, 0), XEXP (trap_rtx, 1),
 			    tcode);
@@ -8382,7 +8382,7 @@  maybe_gen_insn (enum insn_code icode, un
 maybe_expand_insn (enum insn_code icode, unsigned int nops,
 		   struct expand_operand *ops)
 {
-  rtx pat = maybe_gen_insn (icode, nops, ops);
+  rtx_insn *pat = maybe_gen_insn (icode, nops, ops);
   if (pat)
     {
       emit_insn (pat);
@@ -8397,7 +8397,7 @@  maybe_expand_insn (enum insn_code icode,
 maybe_expand_jump_insn (enum insn_code icode, unsigned int nops,
 			struct expand_operand *ops)
 {
-  rtx pat = maybe_gen_insn (icode, nops, ops);
+  rtx_insn *pat = maybe_gen_insn (icode, nops, ops);
   if (pat)
     {
       emit_jump_insn (pat);
Index: gcc/optabs.h
===================================================================
--- gcc/optabs.h	2015-06-06 11:33:59.788667360 +0100
+++ gcc/optabs.h	2015-06-06 11:33:59.764667641 +0100
@@ -377,13 +377,13 @@  rtx emit_conditional_add (rtx, enum rtx_
 /* Create but don't emit one rtl instruction to perform certain operations.
    Modes must match; operands must meet the operation's predicates.
    Likewise for subtraction and for just copying.  */
-extern rtx gen_add2_insn (rtx, rtx);
-extern rtx gen_add3_insn (rtx, rtx, rtx);
+extern rtx_insn *gen_add2_insn (rtx, rtx);
+extern rtx_insn *gen_add3_insn (rtx, rtx, rtx);
 extern int have_add2_insn (rtx, rtx);
-extern rtx gen_addptr3_insn (rtx, rtx, rtx);
+extern rtx_insn *gen_addptr3_insn (rtx, rtx, rtx);
 extern int have_addptr3_insn (rtx, rtx, rtx);
-extern rtx gen_sub2_insn (rtx, rtx);
-extern rtx gen_sub3_insn (rtx, rtx, rtx);
+extern rtx_insn *gen_sub2_insn (rtx, rtx);
+extern rtx_insn *gen_sub3_insn (rtx, rtx, rtx);
 extern int have_sub2_insn (rtx, rtx);
 
 /* Return the INSN_CODE to use for an extend operation.  */
@@ -391,8 +391,7 @@  extern enum insn_code can_extend_p (mach
 
 /* Generate the body of an insn to extend Y (with mode MFROM)
    into X (with mode MTO).  Do zero-extension if UNSIGNEDP is nonzero.  */
-extern rtx gen_extend_insn (rtx, rtx, machine_mode,
-			    machine_mode, int);
+extern rtx_insn *gen_extend_insn (rtx, rtx, machine_mode, machine_mode, int);
 
 /* Return the insn_code for a FLOAT_EXPR.  */
 enum insn_code can_float_p (machine_mode, machine_mode, int);
@@ -488,7 +487,7 @@  extern void init_tree_optimization_optab
 extern void init_sync_libfuncs (int max);
 
 /* Generate a conditional trap instruction.  */
-extern rtx gen_cond_trap (enum rtx_code, rtx, rtx, rtx);
+extern rtx_insn *gen_cond_trap (enum rtx_code, rtx, rtx, rtx);
 
 /* Return true if target supports vector operations for VEC_PERM_EXPR.  */
 extern bool can_vec_perm_p (machine_mode, bool, const unsigned char *);
Index: gcc/print-rtl.c
===================================================================
--- gcc/print-rtl.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/print-rtl.c	2015-06-06 11:33:59.764667641 +0100
@@ -769,7 +769,7 @@  debug_rtx_range (const rtx_insn *start,
    and then call debug_rtx_list to print it, using DEBUG_RTX_COUNT.
    The found insn is returned to enable further debugging analysis.  */
 
-DEBUG_FUNCTION const_rtx
+DEBUG_FUNCTION const rtx_insn *
 debug_rtx_find (const rtx_insn *x, int uid)
 {
   while (x != 0 && INSN_UID (x) != uid)
Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h	2015-06-06 11:33:59.788667360 +0100
+++ gcc/rtl.h	2015-06-06 11:33:59.768667594 +0100
@@ -3525,7 +3525,7 @@  extern void debug (const rtx_def *ptr);
 extern void debug_rtx (const_rtx);
 extern void debug_rtx_list (const rtx_insn *, int);
 extern void debug_rtx_range (const rtx_insn *, const rtx_insn *);
-extern const_rtx debug_rtx_find (const rtx_insn *, int);
+extern const rtx_insn *debug_rtx_find (const rtx_insn *, int);
 extern void print_mem_expr (FILE *, const_tree);
 extern void print_rtl (FILE *, const_rtx);
 extern void print_simple_rtl (FILE *, const_rtx);
Index: gcc/bb-reorder.c
===================================================================
--- gcc/bb-reorder.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/bb-reorder.c	2015-06-06 11:33:59.768667594 +0100
@@ -1391,12 +1391,11 @@  copy_bb_p (const_basic_block bb, int cod
 int
 get_uncond_jump_length (void)
 {
-  rtx_insn *label, *jump;
   int length;
 
   start_sequence ();
-  label = emit_label (gen_label_rtx ());
-  jump = emit_jump_insn (gen_jump (label));
+  rtx_code_label *label = emit_label (gen_label_rtx ());
+  rtx_insn *jump = emit_jump_insn (gen_jump (label));
   length = get_attr_min_length (jump);
   end_sequence ();
 
@@ -1412,8 +1411,7 @@  fix_up_crossing_landing_pad (eh_landing_
 {
   eh_landing_pad new_lp;
   basic_block new_bb, last_bb, post_bb;
-  rtx_insn *new_label, *jump;
-  rtx post_label;
+  rtx_insn *jump;
   unsigned new_partition;
   edge_iterator ei;
   edge e;
@@ -1425,13 +1423,13 @@  fix_up_crossing_landing_pad (eh_landing_
   LABEL_PRESERVE_P (new_lp->landing_pad) = 1;
 
   /* Put appropriate instructions in new bb.  */
-  new_label = emit_label (new_lp->landing_pad);
+  rtx_code_label *new_label = emit_label (new_lp->landing_pad);
 
   expand_dw2_landing_pad_for_region (old_lp->region);
 
   post_bb = BLOCK_FOR_INSN (old_lp->landing_pad);
   post_bb = single_succ (post_bb);
-  post_label = block_label (post_bb);
+  rtx_code_label *post_label = block_label (post_bb);
   jump = emit_jump_insn (gen_jump (post_label));
   JUMP_LABEL (jump) = post_label;
 
@@ -1754,14 +1752,13 @@  add_labels_and_missing_jumps (vec<edge>
     {
       basic_block src = e->src;
       basic_block dest = e->dest;
-      rtx label;
-      rtx_insn *new_jump;
+      rtx_jump_insn *new_jump;
 
       if (dest == EXIT_BLOCK_PTR_FOR_FN (cfun))
 	continue;
 
       /* Make sure dest has a label.  */
-      label = block_label (dest);
+      rtx_code_label *label = block_label (dest);
 
       /* Nothing to do for non-fallthru edges.  */
       if (src == ENTRY_BLOCK_PTR_FOR_FN (cfun))
@@ -1812,7 +1809,7 @@  fix_up_fall_thru_edges (void)
   bool cond_jump_crosses;
   int invert_worked;
   rtx_insn *old_jump;
-  rtx fall_thru_label;
+  rtx_code_label *fall_thru_label;
 
   FOR_EACH_BB_FN (cur_bb, cfun)
     {
Index: gcc/builtins.c
===================================================================
--- gcc/builtins.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/builtins.c	2015-06-06 11:33:59.768667594 +0100
@@ -1560,11 +1560,10 @@  expand_builtin_apply_args (void)
        saved on entry to this function.  So we migrate the
        call to the first insn of this function.  */
     rtx temp;
-    rtx seq;
 
     start_sequence ();
     temp = expand_builtin_apply_args_1 ();
-    seq = get_insns ();
+    rtx_insn *seq = get_insns ();
     end_sequence ();
 
     apply_args_value = temp;
@@ -6397,7 +6396,7 @@  expand_builtin (tree exp, rtx target, rt
 	  rtx buf_addr = expand_expr (CALL_EXPR_ARG (exp, 0), subtarget,
 				      VOIDmode, EXPAND_NORMAL);
 	  tree label = TREE_OPERAND (CALL_EXPR_ARG (exp, 1), 0);
-	  rtx label_r = label_rtx (label);
+	  rtx_insn *label_r = label_rtx (label);
 
 	  /* This is copied from the handling of non-local gotos.  */
 	  expand_builtin_setjmp_setup (buf_addr, label_r);
@@ -6417,7 +6416,7 @@  expand_builtin (tree exp, rtx target, rt
       if (validate_arglist (exp, POINTER_TYPE, VOID_TYPE))
 	{
 	  tree label = TREE_OPERAND (CALL_EXPR_ARG (exp, 0), 0);
-	  rtx label_r = label_rtx (label);
+	  rtx_insn *label_r = label_rtx (label);
 
 	  expand_builtin_setjmp_receiver (label_r);
 	  return const0_rtx;
Index: gcc/calls.c
===================================================================
--- gcc/calls.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/calls.c	2015-06-06 11:33:59.768667594 +0100
@@ -309,7 +309,6 @@  emit_call_1 (rtx funexp, tree fntree ATT
 	     cumulative_args_t args_so_far ATTRIBUTE_UNUSED)
 {
   rtx rounded_stack_size_rtx = GEN_INT (rounded_stack_size);
-  rtx_insn *call_insn;
   rtx call, funmem;
   int already_popped = 0;
   HOST_WIDE_INT n_popped
@@ -435,7 +434,7 @@  emit_call_1 (rtx funexp, tree fntree ATT
     gcc_unreachable ();
 
   /* Find the call we just emitted.  */
-  call_insn = last_call_insn ();
+  rtx_call_insn *call_insn = last_call_insn ();
 
   /* Some target create a fresh MEM instead of reusing the one provided
      above.  Set its MEM_EXPR.  */
@@ -4437,9 +4436,9 @@  emit_library_call_value_1 (int retval, r
 
   if (flag_ipa_ra)
     {
-      rtx last, datum = orgfun;
+      rtx datum = orgfun;
       gcc_assert (GET_CODE (datum) == SYMBOL_REF);
-      last = last_call_insn ();
+      rtx_call_insn *last = last_call_insn ();
       add_reg_note (last, REG_CALL_DECL, datum);
     }
 
Index: gcc/cfgbuild.c
===================================================================
--- gcc/cfgbuild.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/cfgbuild.c	2015-06-06 11:33:59.768667594 +0100
@@ -174,7 +174,7 @@  rtl_make_eh_edge (sbitmap edge_cache, ba
 
   if (lp)
     {
-      rtx label = lp->landing_pad;
+      rtx_insn *label = lp->landing_pad;
 
       /* During initial rtl generation, use the post_landing_pad.  */
       if (label == NULL)
Index: gcc/cfgexpand.c
===================================================================
--- gcc/cfgexpand.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/cfgexpand.c	2015-06-06 11:33:59.768667594 +0100
@@ -2900,7 +2900,7 @@  expand_asm_stmt (gasm *stmt)
       for (i = 0; i < nlabels; ++i)
 	{
 	  tree label = TREE_VALUE (gimple_asm_label_op (stmt, i));
-	  rtx r;
+	  rtx_insn *r;
 	  /* If asm goto has any labels in the fallthru basic block, use
 	     a label that we emit immediately after the asm goto.  Expansion
 	     may insert further instructions into the same basic block after
Index: gcc/cfgrtl.c
===================================================================
--- gcc/cfgrtl.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/cfgrtl.c	2015-06-06 11:33:59.772667547 +0100
@@ -92,7 +92,6 @@  static GTY(()) rtx_insn *cfg_layout_func
 
 static rtx_insn *skip_insns_after_block (basic_block);
 static void record_effective_endpoints (void);
-static rtx label_for_bb (basic_block);
 static void fixup_reorder_chain (void);
 
 void verify_insn_chain (void);
@@ -1120,7 +1119,7 @@  try_redirect_by_replacing_jump (edge e,
   /* Or replace possibly complicated jump insn by simple jump insn.  */
   else
     {
-      rtx target_label = block_label (target);
+      rtx_code_label *target_label = block_label (target);
       rtx_insn *barrier;
       rtx label;
       rtx_jump_table_data *table;
@@ -1203,7 +1202,7 @@  patch_jump_insn (rtx_insn *insn, rtx_ins
     {
       rtvec vec;
       int j;
-      rtx new_label = block_label (new_bb);
+      rtx_code_label *new_label = block_label (new_bb);
 
       if (new_bb == EXIT_BLOCK_PTR_FOR_FN (cfun))
 	return false;
@@ -1233,11 +1232,11 @@  patch_jump_insn (rtx_insn *insn, rtx_ins
   else if ((tmp = extract_asm_operands (PATTERN (insn))) != NULL)
     {
       int i, n = ASM_OPERANDS_LABEL_LENGTH (tmp);
-      rtx new_label, note;
+      rtx note;
 
       if (new_bb == EXIT_BLOCK_PTR_FOR_FN (cfun))
 	return false;
-      new_label = block_label (new_bb);
+      rtx_code_label *new_label = block_label (new_bb);
 
       for (i = 0; i < n; ++i)
 	{
@@ -1722,7 +1721,7 @@  force_nonfallthru_and_redirect (edge e,
     }
   else
     {
-      rtx label = block_label (target);
+      rtx_code_label *label = block_label (target);
       emit_jump_insn_after_setloc (gen_jump (label), BB_END (jump_block), loc);
       JUMP_LABEL (BB_END (jump_block)) = label;
       LABEL_NUSES (label)++;
@@ -3464,10 +3463,10 @@  skip_insns_after_block (basic_block bb)
 
 /* Locate or create a label for a given basic block.  */
 
-static rtx
+static rtx_insn *
 label_for_bb (basic_block bb)
 {
-  rtx label = BB_HEAD (bb);
+  rtx_insn *label = BB_HEAD (bb);
 
   if (!LABEL_P (label))
     {
Index: gcc/cilk-common.c
===================================================================
--- gcc/cilk-common.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/cilk-common.c	2015-06-06 11:33:59.772667547 +0100
@@ -370,7 +370,7 @@  expand_builtin_cilk_pop_frame (tree exp)
 void
 expand_builtin_cilk_detach (tree exp)
 {
-  rtx insn;
+  rtx_insn *insn;
   tree fptr = get_frame_arg (exp);
 
   if (fptr == NULL_TREE)
Index: gcc/config/i386/i386.md
===================================================================
--- gcc/config/i386/i386.md	2015-06-06 11:33:59.788667360 +0100
+++ gcc/config/i386/i386.md	2015-06-06 11:33:59.772667547 +0100
@@ -7186,7 +7186,7 @@  (define_expand "divmodqi4"
 	      (clobber (reg:CC FLAGS_REG))])]
   "TARGET_QIMODE_MATH"
 {
-  rtx div, mod, insn;
+  rtx div, mod;
   rtx tmp0, tmp1;
   
   tmp0 = gen_reg_rtx (HImode);
@@ -7199,7 +7199,7 @@  (define_expand "divmodqi4"
 
   /* Extract remainder from AH.  */
   tmp1 = gen_rtx_SIGN_EXTRACT (QImode, tmp0, GEN_INT (8), GEN_INT (8));
-  insn = emit_move_insn (operands[3], tmp1);
+  rtx_insn *insn = emit_move_insn (operands[3], tmp1);
 
   mod = gen_rtx_MOD (QImode, operands[1], operands[2]);
   set_unique_reg_note (insn, REG_EQUAL, mod);
@@ -7358,7 +7358,7 @@  (define_expand "udivmodqi4"
 	      (clobber (reg:CC FLAGS_REG))])]
   "TARGET_QIMODE_MATH"
 {
-  rtx div, mod, insn;
+  rtx div, mod;
   rtx tmp0, tmp1;
   
   tmp0 = gen_reg_rtx (HImode);
@@ -7372,7 +7372,7 @@  (define_expand "udivmodqi4"
   /* Extract remainder from AH.  */
   tmp1 = gen_rtx_ZERO_EXTRACT (SImode, tmp0, GEN_INT (8), GEN_INT (8));
   tmp1 = simplify_gen_subreg (QImode, tmp1, SImode, 0);
-  insn = emit_move_insn (operands[3], tmp1);
+  rtx_insn *insn = emit_move_insn (operands[3], tmp1);
 
   mod = gen_rtx_UMOD (QImode, operands[1], operands[2]);
   set_unique_reg_note (insn, REG_EQUAL, mod);
Index: gcc/cse.c
===================================================================
--- gcc/cse.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/cse.c	2015-06-06 11:33:59.772667547 +0100
@@ -5487,7 +5487,7 @@  cse_insn (rtx_insn *insn)
 	     and hope for the best.  */
 	  if (n_sets == 1)
 	    {
-	      rtx_insn *new_rtx;
+	      rtx_jump_insn *new_rtx;
 	      rtx note;
 
 	      new_rtx = emit_jump_insn_before (gen_jump (XEXP (src, 0)), insn);
@@ -6845,7 +6845,7 @@  is_dead_reg (const_rtx x, int *counts)
 set_live_p (rtx set, rtx_insn *insn ATTRIBUTE_UNUSED, /* Only used with HAVE_cc0.  */
 	    int *counts)
 {
-  rtx tem;
+  rtx_insn *tem;
 
   if (set_noop_p (set))
     ;
Index: gcc/dwarf2cfi.c
===================================================================
--- gcc/dwarf2cfi.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/dwarf2cfi.c	2015-06-06 11:33:59.776667501 +0100
@@ -2242,7 +2242,6 @@  add_cfis_to_fde (void)
 	      int num = dwarf2out_cfi_label_num;
 	      const char *label = dwarf2out_cfi_label ();
 	      dw_cfi_ref xcfi;
-	      rtx tmp;
 
 	      /* Set the location counter to the new label.  */
 	      xcfi = new_cfi ();
@@ -2251,7 +2250,7 @@  add_cfis_to_fde (void)
 	      xcfi->dw_cfi_oprnd1.dw_cfi_addr = label;
 	      vec_safe_push (fde->dw_fde_cfi, xcfi);
 
-	      tmp = emit_note_before (NOTE_INSN_CFI_LABEL, insn);
+	      rtx_note *tmp = emit_note_before (NOTE_INSN_CFI_LABEL, insn);
 	      NOTE_LABEL_NUMBER (tmp) = num;
 	    }
 
Index: gcc/except.c
===================================================================
--- gcc/except.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/except.c	2015-06-06 11:33:59.776667501 +0100
@@ -1299,9 +1299,8 @@  sjlj_emit_dispatch_table (rtx_code_label
   machine_mode unwind_word_mode = targetm.unwind_word_mode ();
   machine_mode filter_mode = targetm.eh_return_filter_mode ();
   eh_landing_pad lp;
-  rtx mem, fc, before, exc_ptr_reg, filter_reg;
+  rtx mem, fc, exc_ptr_reg, filter_reg;
   rtx_insn *seq;
-  rtx first_reachable_label;
   basic_block bb;
   eh_region r;
   edge e;
@@ -1348,7 +1347,7 @@  sjlj_emit_dispatch_table (rtx_code_label
   /* Jump to one of the directly reachable regions.  */
 
   disp_index = 0;
-  first_reachable_label = NULL;
+  rtx_code_label *first_reachable_label = NULL;
 
   /* If there's exactly one call site in the function, don't bother
      generating a switch statement.  */
@@ -1391,7 +1390,7 @@  sjlj_emit_dispatch_table (rtx_code_label
 	seq2 = get_insns ();
 	end_sequence ();
 
-	before = label_rtx (lp->post_landing_pad);
+	rtx_insn *before = label_rtx (lp->post_landing_pad);
 	bb = emit_to_new_bb_before (seq2, before);
 	e = make_edge (bb, bb->next_bb, EDGE_FALLTHRU);
 	e->count = bb->count;
@@ -1684,7 +1683,7 @@  for_each_eh_label (void (*callback) (rtx
     {
       if (lp)
 	{
-	  rtx lab = lp->landing_pad;
+	  rtx_code_label *lab = lp->landing_pad;
 	  if (lab && LABEL_P (lab))
 	    (*callback) (lab);
 	}
@@ -2518,7 +2517,7 @@  convert_to_eh_region_ranges (void)
   rtx_insn *first_no_action_insn = NULL;
   int call_site = 0;
   int cur_sec = 0;
-  rtx section_switch_note = NULL_RTX;
+  rtx_insn *section_switch_note = NULL;
   rtx_insn *first_no_action_insn_before_switch = NULL;
   rtx_insn *last_no_action_insn_before_switch = NULL;
   int saved_call_site_base = call_site_base;
@@ -2532,7 +2531,7 @@  convert_to_eh_region_ranges (void)
 	eh_region region;
 	bool nothrow;
 	int this_action;
-	rtx this_landing_pad;
+	rtx_code_label *this_landing_pad;
 
 	insn = iter;
 	if (NONJUMP_INSN_P (insn)
@@ -2563,7 +2562,7 @@  convert_to_eh_region_ranges (void)
 	if (this_action >= 0)
 	  this_landing_pad = lp->landing_pad;
 	else
-	  this_landing_pad = NULL_RTX;
+	  this_landing_pad = NULL;
 
 	/* Differing actions or landing pads implies a change in call-site
 	   info, which implies some EH_REGION note should be emitted.  */
@@ -3266,7 +3265,7 @@  dump_eh_tree (FILE * out, struct functio
 		    fprintf (out, "(nil),");
 		  if (lp->post_landing_pad)
 		    {
-		      rtx lab = label_rtx (lp->post_landing_pad);
+		      rtx_insn *lab = label_rtx (lp->post_landing_pad);
 		      fprintf (out, "%i%s}", INSN_UID (lab),
 			       NOTE_P (lab) ? "(del)" : "");
 		    }
Index: gcc/final.c
===================================================================
--- gcc/final.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/final.c	2015-06-06 11:33:59.776667501 +0100
@@ -657,13 +657,13 @@  align_fuzz (rtx start, rtx end, int know
 int
 insn_current_reference_address (rtx_insn *branch)
 {
-  rtx dest, seq;
+  rtx dest;
   int seq_uid;
 
   if (! INSN_ADDRESSES_SET_P ())
     return 0;
 
-  seq = NEXT_INSN (PREV_INSN (branch));
+  rtx_insn *seq = NEXT_INSN (PREV_INSN (branch));
   seq_uid = INSN_UID (seq);
   if (!JUMP_P (branch))
     /* This can happen for example on the PA; the objective is to know the
Index: gcc/function.c
===================================================================
--- gcc/function.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/function.c	2015-06-06 11:33:59.776667501 +0100
@@ -3109,8 +3109,8 @@  assign_parm_setup_reg (struct assign_par
 	    }
 	  else
 	    t = op1;
-	  rtx pat = gen_extend_insn (op0, t, promoted_nominal_mode,
-				     data->passed_mode, unsignedp);
+	  rtx_insn *pat = gen_extend_insn (op0, t, promoted_nominal_mode,
+					   data->passed_mode, unsignedp);
 	  emit_insn (pat);
 	  insns = get_insns ();
 
@@ -5290,8 +5290,6 @@  set_insn_locations (rtx_insn *insn, int
 void
 expand_function_end (void)
 {
-  rtx clobber_after;
-
   /* If arg_pointer_save_area was referenced only from a nested
      function, we will not have initialized it yet.  Do that now.  */
   if (arg_pointer_save_area && ! crtl->arg_pointer_save_area_init)
@@ -5340,7 +5338,7 @@  expand_function_end (void)
 
      We delay actual code generation after the current_function_value_rtx
      is computed.  */
-  clobber_after = get_last_insn ();
+  rtx_insn *clobber_after = get_last_insn ();
 
   /* Output the label for the actual return from the function.  */
   emit_label (return_label);
@@ -5490,11 +5488,9 @@  expand_function_end (void)
      certainly doesn't fall thru into the exit block.  */
   if (!BARRIER_P (clobber_after))
     {
-      rtx seq;
-
       start_sequence ();
       clobber_return_register ();
-      seq = get_insns ();
+      rtx_insn *seq = get_insns ();
       end_sequence ();
 
       emit_insn_after (seq, clobber_after);
@@ -5521,11 +5517,11 @@  expand_function_end (void)
   if (! EXIT_IGNORE_STACK
       && cfun->calls_alloca)
     {
-      rtx tem = 0, seq;
+      rtx tem = 0;
 
       start_sequence ();
       emit_stack_save (SAVE_FUNCTION, &tem);
-      seq = get_insns ();
+      rtx_insn *seq = get_insns ();
       end_sequence ();
       emit_insn_before (seq, parm_birth_insn);
 
@@ -5552,15 +5548,13 @@  get_arg_pointer_save_area (void)
 
   if (! crtl->arg_pointer_save_area_init)
     {
-      rtx seq;
-
       /* Save the arg pointer at the beginning of the function.  The
 	 generated stack slot may not be a valid memory address, so we
 	 have to check it and fix it if necessary.  */
       start_sequence ();
       emit_move_insn (validize_mem (copy_rtx (ret)),
                       crtl->args.internal_arg_pointer);
-      seq = get_insns ();
+      rtx_insn *seq = get_insns ();
       end_sequence ();
 
       push_topmost_sequence ();
@@ -5653,13 +5647,11 @@  prologue_epilogue_contains (const_rtx in
 static void
 emit_use_return_register_into_block (basic_block bb)
 {
-  rtx seq;
- rtx_insn *insn;
   start_sequence ();
   use_return_register ();
-  seq = get_insns ();
+  rtx_insn *seq = get_insns ();
   end_sequence ();
-  insn = BB_END (bb);
+  rtx_insn *insn = BB_END (bb);
   if (HAVE_cc0 && reg_mentioned_p (cc0_rtx, PATTERN (insn)))
     insn = prev_cc0_setter (insn);
 
@@ -5686,9 +5678,9 @@  gen_return_pattern (bool simple_p)
 void
 emit_return_into_block (bool simple_p, basic_block bb)
 {
-  rtx jump, pat;
-  jump = emit_jump_insn_after (gen_return_pattern (simple_p), BB_END (bb));
-  pat = PATTERN (jump);
+  rtx_jump_insn *jump = emit_jump_insn_after (gen_return_pattern (simple_p),
+					      BB_END (bb));
+  rtx pat = PATTERN (jump);
   if (GET_CODE (pat) == PARALLEL)
     pat = XVECEXP (pat, 0, 0);
   gcc_assert (ANY_RETURN_P (pat));
@@ -5733,7 +5725,6 @@  convert_jumps_to_returns (basic_block la
 {
   int i;
   basic_block bb;
-  rtx label;
   edge_iterator ei;
   edge e;
   auto_vec<basic_block> src_bbs (EDGE_COUNT (last_bb->preds));
@@ -5742,7 +5733,7 @@  convert_jumps_to_returns (basic_block la
     if (e->src != ENTRY_BLOCK_PTR_FOR_FN (cfun))
       src_bbs.quick_push (e->src);
 
-  label = BB_HEAD (last_bb);
+  rtx_insn *label = BB_HEAD (last_bb);
 
   FOR_EACH_VEC_ELT (src_bbs, i, bb)
     {
Index: gcc/gcse-common.c
===================================================================
--- gcc/gcse-common.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/gcse-common.c	2015-06-06 11:33:59.776667501 +0100
@@ -40,7 +40,7 @@ 
 void
 canon_list_insert (rtx dest, const_rtx x ATTRIBUTE_UNUSED, void *data)
 {
-  rtx dest_addr, insn;
+  rtx dest_addr;
   int bb;
   modify_pair pair;
 
@@ -58,7 +58,7 @@  canon_list_insert (rtx dest, const_rtx x
 
   dest_addr = get_addr (XEXP (dest, 0));
   dest_addr = canon_rtx (dest_addr);
-  insn = ((struct gcse_note_stores_info *)data)->insn;
+  rtx_insn *insn = ((struct gcse_note_stores_info *)data)->insn;
   bb = BLOCK_FOR_INSN (insn)->index;
 
   pair.dest = dest;
Index: gcc/genemit.c
===================================================================
--- gcc/genemit.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/genemit.c	2015-06-06 11:33:59.776667501 +0100
@@ -450,7 +450,7 @@  gen_expand (rtx expand)
     printf ("  rtx operand%d;\n", i);
   for (; i <= stats.max_scratch_opno; i++)
     printf ("  rtx operand%d ATTRIBUTE_UNUSED;\n", i);
-  printf ("  rtx _val = 0;\n");
+  printf ("  rtx_insn *_val = 0;\n");
   printf ("  start_sequence ();\n");
 
   /* The fourth operand of DEFINE_EXPAND is some code to be executed
Index: gcc/haifa-sched.c
===================================================================
--- gcc/haifa-sched.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/haifa-sched.c	2015-06-06 11:33:59.776667501 +0100
@@ -8096,8 +8096,6 @@  init_before_recovery (basic_block *befor
          Between these two blocks recovery blocks will be emitted.  */
 
       basic_block single, empty;
-      rtx_insn *x;
-      rtx label;
 
       /* If the fallthrough edge to exit we've found is from the block we've
 	 created before, don't do anything more.  */
@@ -8128,8 +8126,9 @@  init_before_recovery (basic_block *befor
       make_single_succ_edge (empty, EXIT_BLOCK_PTR_FOR_FN (cfun),
 			     EDGE_FALLTHRU);
 
-      label = block_label (empty);
-      x = emit_jump_insn_after (gen_jump (label), BB_END (single));
+      rtx_code_label *label = block_label (empty);
+      rtx_jump_insn *x = emit_jump_insn_after (gen_jump (label),
+					       BB_END (single));
       JUMP_LABEL (x) = label;
       LABEL_NUSES (label)++;
       haifa_init_insn (x);
@@ -8160,7 +8159,6 @@  init_before_recovery (basic_block *befor
 basic_block
 sched_create_recovery_block (basic_block *before_recovery_ptr)
 {
-  rtx label;
   rtx_insn *barrier;
   basic_block rec;
 
@@ -8172,7 +8170,7 @@  sched_create_recovery_block (basic_block
   barrier = get_last_bb_insn (before_recovery);
   gcc_assert (BARRIER_P (barrier));
 
-  label = emit_label_after (gen_label_rtx (), barrier);
+  rtx_insn *label = emit_label_after (gen_label_rtx (), barrier);
 
   rec = create_basic_block (label, label, before_recovery);
 
@@ -8195,8 +8193,6 @@  sched_create_recovery_block (basic_block
 sched_create_recovery_edges (basic_block first_bb, basic_block rec,
 			     basic_block second_bb)
 {
-  rtx label;
-  rtx jump;
   int edge_flags;
 
   /* This is fixing of incoming edge.  */
@@ -8208,8 +8204,8 @@  sched_create_recovery_edges (basic_block
     edge_flags = 0;
 
   make_edge (first_bb, rec, edge_flags);
-  label = block_label (second_bb);
-  jump = emit_jump_insn_after (gen_jump (label), BB_END (rec));
+  rtx_code_label *label = block_label (second_bb);
+  rtx_jump_insn *jump = emit_jump_insn_after (gen_jump (label), BB_END (rec));
   JUMP_LABEL (jump) = label;
   LABEL_NUSES (label)++;
 
Index: gcc/ifcvt.c
===================================================================
--- gcc/ifcvt.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/ifcvt.c	2015-06-06 11:33:59.780667454 +0100
@@ -3767,7 +3767,7 @@  find_cond_trap (basic_block test_bb, edg
   basic_block else_bb = else_edge->dest;
   basic_block other_bb, trap_bb;
   rtx_insn *trap, *jump;
-  rtx cond, seq;
+  rtx cond;
   rtx_insn *cond_earliest;
   enum rtx_code code;
 
@@ -3812,9 +3812,9 @@  find_cond_trap (basic_block test_bb, edg
     }
 
   /* Attempt to generate the conditional trap.  */
-  seq = gen_cond_trap (code, copy_rtx (XEXP (cond, 0)),
-		       copy_rtx (XEXP (cond, 1)),
-		       TRAP_CODE (PATTERN (trap)));
+  rtx_insn *seq = gen_cond_trap (code, copy_rtx (XEXP (cond, 0)),
+				 copy_rtx (XEXP (cond, 1)),
+				 TRAP_CODE (PATTERN (trap)));
   if (seq == NULL)
     return FALSE;
 
@@ -3839,10 +3839,9 @@  find_cond_trap (basic_block test_bb, edg
   else if (trap_bb == then_bb)
     {
       rtx lab;
-      rtx_insn *newjump;
 
       lab = JUMP_LABEL (jump);
-      newjump = emit_jump_insn_after (gen_jump (lab), jump);
+      rtx_jump_insn *newjump = emit_jump_insn_after (gen_jump (lab), jump);
       LABEL_NUSES (lab) += 1;
       JUMP_LABEL (newjump) = lab;
       emit_barrier_after (newjump);
Index: gcc/jump.c
===================================================================
--- gcc/jump.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/jump.c	2015-06-06 11:33:59.780667454 +0100
@@ -441,7 +441,6 @@  reversed_comparison_code_parts (enum rtx
 
   if (GET_MODE_CLASS (mode) == MODE_CC || CC0_P (arg0))
     {
-      const_rtx prev;
       /* Try to search for the comparison to determine the real mode.
          This code is expensive, but with sane machine description it
          will be never used, since REVERSIBLE_CC_MODE will return true
@@ -452,9 +451,9 @@  reversed_comparison_code_parts (enum rtx
       /* These CONST_CAST's are okay because prev_nonnote_insn just
 	 returns its argument and we assign it to a const_rtx
 	 variable.  */
-      for (prev = prev_nonnote_insn (CONST_CAST_RTX (insn));
+      for (rtx_insn *prev = prev_nonnote_insn (CONST_CAST_RTX (insn));
 	   prev != 0 && !LABEL_P (prev);
-	   prev = prev_nonnote_insn (CONST_CAST_RTX (prev)))
+	   prev = prev_nonnote_insn (prev))
 	{
 	  const_rtx set = set_of (arg0, prev);
 	  if (set && GET_CODE (set) == SET
Index: gcc/loop-invariant.c
===================================================================
--- gcc/loop-invariant.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/loop-invariant.c	2015-06-06 11:33:59.780667454 +0100
@@ -882,14 +882,13 @@  pre_check_invariant_p (bool simple, rtx
   if (simple && REG_P (dest) && DF_REG_DEF_COUNT (REGNO (dest)) > 1)
     {
       df_ref use;
-      rtx ref;
       unsigned int i = REGNO (dest);
       struct df_insn_info *insn_info;
       df_ref def_rec;
 
       for (use = DF_REG_USE_CHAIN (i); use; use = DF_REF_NEXT_REG (use))
 	{
-	  ref = DF_REF_INSN (use);
+	  rtx_insn *ref = DF_REF_INSN (use);
 	  insn_info = DF_INSN_INFO_GET (ref);
 
 	  FOR_EACH_INSN_INFO_DEF (def_rec, insn_info)
Index: gcc/loop-iv.c
===================================================================
--- gcc/loop-iv.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/loop-iv.c	2015-06-06 11:33:59.780667454 +0100
@@ -2036,7 +2036,7 @@  simplify_using_initial_values (struct lo
 
 	      for (pnote = &cond_list; *pnote; pnote = pnote_next)
 		{
-		  rtx note = *pnote;
+		  rtx_expr_list *note = *pnote;
 		  rtx old_cond = XEXP (note, 0);
 
 		  pnote_next = (rtx_expr_list **)&XEXP (note, 1);
@@ -2070,7 +2070,7 @@  simplify_using_initial_values (struct lo
 	      /* Likewise for the conditions.  */
 	      for (pnote = &cond_list; *pnote; pnote = pnote_next)
 		{
-		  rtx note = *pnote;
+		  rtx_expr_list *note = *pnote;
 		  rtx old_cond = XEXP (note, 0);
 
 		  pnote_next = (rtx_expr_list **)&XEXP (note, 1);
Index: gcc/lra-constraints.c
===================================================================
--- gcc/lra-constraints.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/lra-constraints.c	2015-06-06 11:33:59.780667454 +0100
@@ -871,7 +871,7 @@  match_reload (signed char out, signed ch
 	      rtx_insn **before, rtx_insn **after)
 {
   int i, in;
-  rtx new_in_reg, new_out_reg, reg, clobber;
+  rtx new_in_reg, new_out_reg, reg;
   machine_mode inmode, outmode;
   rtx in_rtx = *curr_id->operand_loc[ins[0]];
   rtx out_rtx = out < 0 ? in_rtx : *curr_id->operand_loc[out];
@@ -912,7 +912,7 @@  match_reload (signed char out, signed ch
 	     NEW_OUT_REG living above.  We add clobber clause for
 	     this.  This is just a temporary clobber.  We can remove
 	     it at the end of LRA work.  */
-	  clobber = emit_clobber (new_out_reg);
+	  rtx_insn *clobber = emit_clobber (new_out_reg);
 	  LRA_TEMP_CLOBBER_P (PATTERN (clobber)) = 1;
 	  LRA_SUBREG_P (new_in_reg) = 1;
 	  if (GET_CODE (in_rtx) == SUBREG)
@@ -5558,7 +5558,7 @@  inherit_in_ebb (rtx_insn *head, rtx_insn
 			   || reg_renumber[src_regno] >= 0)
 		    {
 		      bool before_p;
-		      rtx use_insn = curr_insn;
+		      rtx_insn *use_insn = curr_insn;
 
 		      before_p = (JUMP_P (curr_insn)
 				  || (CALL_P (curr_insn) && reg->type == OP_IN));
Index: gcc/lra.c
===================================================================
--- gcc/lra.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/lra.c	2015-06-06 11:33:59.780667454 +0100
@@ -306,7 +306,7 @@  lra_delete_dead_insn (rtx_insn *insn)
 /* Emit insn x = y + z.  Return NULL if we failed to do it.
    Otherwise, return the insn.  We don't use gen_add3_insn as it might
    clobber CC.  */
-static rtx
+static rtx_insn *
 emit_add3_insn (rtx x, rtx y, rtx z)
 {
   rtx_insn *last;
@@ -315,7 +315,7 @@  emit_add3_insn (rtx x, rtx y, rtx z)
 
   if (have_addptr3_insn (x, y, z))
     {
-      rtx insn = gen_addptr3_insn (x, y, z);
+      rtx_insn *insn = gen_addptr3_insn (x, y, z);
 
       /* If the target provides an "addptr" pattern it hopefully does
 	 for a reason.  So falling back to the normal add would be
@@ -337,12 +337,10 @@  emit_add3_insn (rtx x, rtx y, rtx z)
 
 /* Emit insn x = x + y.  Return the insn.  We use gen_add2_insn as the
    last resort.  */
-static rtx
+static rtx_insn *
 emit_add2_insn (rtx x, rtx y)
 {
-  rtx insn;
-
-  insn = emit_add3_insn (x, x, y);
+  rtx_insn *insn = emit_add3_insn (x, x, y);
   if (insn == NULL_RTX)
     {
       insn = gen_add2_insn (x, y);
@@ -370,7 +368,7 @@  lra_emit_add (rtx x, rtx y, rtx z)
   rtx a1, a2, base, index, disp, scale, index_scale;
   bool ok_p;
 
-  rtx add3_insn = emit_add3_insn (x, y, z);
+  rtx_insn *add3_insn = emit_add3_insn (x, y, z);
   old = max_reg_num ();
   if (add3_insn != NULL)
     ;
@@ -423,7 +421,7 @@  lra_emit_add (rtx x, rtx y, rtx z)
 	     adding the address segment to register.  */
 	  lra_assert (x != y && x != z);
 	  emit_move_insn (x, y);
-	  rtx insn = emit_add2_insn (x, z);
+	  rtx_insn *insn = emit_add2_insn (x, z);
 	  lra_assert (insn != NULL_RTX);
 	}
       else
@@ -435,7 +433,7 @@  lra_emit_add (rtx x, rtx y, rtx z)
 	      /* Generate x = index_scale; x = x + base.  */
 	      lra_assert (index_scale != NULL_RTX && base != NULL_RTX);
 	      emit_move_insn (x, index_scale);
-	      rtx insn = emit_add2_insn (x, base);
+	      rtx_insn *insn = emit_add2_insn (x, base);
 	      lra_assert (insn != NULL_RTX);
 	    }
 	  else if (scale == NULL_RTX)
@@ -450,13 +448,13 @@  lra_emit_add (rtx x, rtx y, rtx z)
 		  delete_insns_since (last);
 		  /* Generate x = disp; x = x + base.  */
 		  emit_move_insn (x, disp);
-		  rtx add2_insn = emit_add2_insn (x, base);
+		  rtx_insn *add2_insn = emit_add2_insn (x, base);
 		  lra_assert (add2_insn != NULL_RTX);
 		}
 	      /* Generate x = x + index.  */
 	      if (index != NULL_RTX)
 		{
-		  rtx insn = emit_add2_insn (x, index);
+		  rtx_insn *insn = emit_add2_insn (x, index);
 		  lra_assert (insn != NULL_RTX);
 		}
 	    }
@@ -468,7 +466,7 @@  lra_emit_add (rtx x, rtx y, rtx z)
 	      ok_p = false;
 	      if (recog_memoized (move_insn) >= 0)
 		{
-		  rtx insn = emit_add2_insn (x, disp);
+		  rtx_insn *insn = emit_add2_insn (x, disp);
 		  if (insn != NULL_RTX)
 		    {
 		      insn = emit_add2_insn (x, base);
@@ -481,7 +479,7 @@  lra_emit_add (rtx x, rtx y, rtx z)
 		  delete_insns_since (last);
 		  /* Generate x = disp; x = x + base; x = x + index_scale.  */
 		  emit_move_insn (x, disp);
-		  rtx insn = emit_add2_insn (x, base);
+		  rtx_insn *insn = emit_add2_insn (x, base);
 		  lra_assert (insn != NULL_RTX);
 		  insn = emit_add2_insn (x, index_scale);
 		  lra_assert (insn != NULL_RTX);
Index: gcc/reload1.c
===================================================================
--- gcc/reload1.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/reload1.c	2015-06-06 11:33:59.780667454 +0100
@@ -1649,7 +1649,7 @@  calculate_elim_costs_all_insns (void)
 		      || reg_equiv_invariant (REGNO (SET_DEST (set)))))
 		{
 		  unsigned regno = REGNO (SET_DEST (set));
-		  rtx init = reg_equiv_init (regno);
+		  rtx_insn_list *init = reg_equiv_init (regno);
 		  if (init)
 		    {
 		      rtx t = eliminate_regs_1 (SET_SRC (set), VOIDmode, insn,
@@ -8226,7 +8226,7 @@  emit_reload_insns (struct insn_chain *ch
 
   for (j = 0; j < reload_n_operands; j++)
     {
-      rtx x = emit_insn_after (outaddr_address_reload_insns[j], insn);
+      rtx_insn *x = emit_insn_after (outaddr_address_reload_insns[j], insn);
       x = emit_insn_after (output_address_reload_insns[j], x);
       x = emit_insn_after (output_reload_insns[j], x);
       emit_insn_after (other_output_reload_insns[j], x);
Index: gcc/resource.c
===================================================================
--- gcc/resource.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/resource.c	2015-06-06 11:33:59.784667407 +0100
@@ -894,7 +894,6 @@  mark_target_live_regs (rtx_insn *insns,
   unsigned int i;
   struct target_info *tinfo = NULL;
   rtx_insn *insn;
-  rtx jump_insn = 0;
   rtx jump_target;
   HARD_REG_SET scratch;
   struct resources set, needed;
@@ -1122,8 +1121,8 @@  mark_target_live_regs (rtx_insn *insns,
   CLEAR_RESOURCE (&set);
   CLEAR_RESOURCE (&needed);
 
-  jump_insn = find_dead_or_set_registers (target, res, &jump_target, 0,
-					  set, needed);
+  rtx_insn *jump_insn = find_dead_or_set_registers (target, res, &jump_target,
+						    0, set, needed);
 
   /* If we hit an unconditional branch, we have another way of finding out
      what is live: we can see what is live at the branch target and include
Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/rtlanal.c	2015-06-06 11:33:59.784667407 +0100
@@ -2226,7 +2226,7 @@  in_insn_list_p (const rtx_insn_list *lis
 remove_node_from_expr_list (const_rtx node, rtx_expr_list **listp)
 {
   rtx_expr_list *temp = *listp;
-  rtx prev = NULL_RTX;
+  rtx_expr_list *prev = NULL;
 
   while (temp)
     {
@@ -2255,7 +2255,7 @@  remove_node_from_expr_list (const_rtx no
 remove_node_from_insn_list (const rtx_insn *node, rtx_insn_list **listp)
 {
   rtx_insn_list *temp = *listp;
-  rtx prev = NULL;
+  rtx_insn_list *prev = NULL;
 
   while (temp)
     {
Index: gcc/sched-deps.c
===================================================================
--- gcc/sched-deps.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/sched-deps.c	2015-06-06 11:33:59.784667407 +0100
@@ -3003,8 +3003,7 @@  sched_analyze_insn (struct deps_desc *de
 
   if (JUMP_P (insn))
     {
-      rtx next;
-      next = next_nonnote_nondebug_insn (insn);
+      rtx_insn *next = next_nonnote_nondebug_insn (insn);
       if (next && BARRIER_P (next))
 	reg_pending_barrier = MOVE_BARRIER;
       else
@@ -3591,8 +3590,6 @@  call_may_noreturn_p (rtx_insn *insn)
 static bool
 chain_to_prev_insn_p (rtx_insn *insn)
 {
-  rtx prev, x;
-
   /* INSN forms a group with the previous instruction.  */
   if (SCHED_GROUP_P (insn))
     return true;
@@ -3601,13 +3598,13 @@  chain_to_prev_insn_p (rtx_insn *insn)
      part of R, the clobber was added specifically to help us track the
      liveness of R.  There's no point scheduling the clobber and leaving
      INSN behind, especially if we move the clobber to another block.  */
-  prev = prev_nonnote_nondebug_insn (insn);
+  rtx_insn *prev = prev_nonnote_nondebug_insn (insn);
   if (prev
       && INSN_P (prev)
       && BLOCK_FOR_INSN (prev) == BLOCK_FOR_INSN (insn)
       && GET_CODE (PATTERN (prev)) == CLOBBER)
     {
-      x = XEXP (PATTERN (prev), 0);
+      rtx x = XEXP (PATTERN (prev), 0);
       if (set_of (x, insn))
 	return true;
     }
Index: gcc/sched-ebb.c
===================================================================
--- gcc/sched-ebb.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/sched-ebb.c	2015-06-06 11:33:59.784667407 +0100
@@ -183,9 +183,7 @@  begin_move_insn (rtx_insn *insn, rtx_ins
 			   && BB_END (last_bb) == insn);
 
       {
-	rtx x;
-
-	x = NEXT_INSN (insn);
+	rtx_insn *x = NEXT_INSN (insn);
 	if (e)
 	  gcc_checking_assert (NOTE_P (x) || LABEL_P (x));
 	else
Index: gcc/sel-sched-ir.c
===================================================================
--- gcc/sel-sched-ir.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/sel-sched-ir.c	2015-06-06 11:33:59.784667407 +0100
@@ -4560,9 +4560,7 @@  sel_bb_head (basic_block bb)
     }
   else
     {
-      insn_t note;
-
-      note = bb_note (bb);
+      rtx_note *note = bb_note (bb);
       head = next_nonnote_insn (note);
 
       if (head && (BARRIER_P (head) || BLOCK_FOR_INSN (head) != bb))
@@ -4983,7 +4981,7 @@  clear_outdated_rtx_info (basic_block bb)
 static void
 return_bb_to_pool (basic_block bb)
 {
-  rtx note = bb_note (bb);
+  rtx_note *note = bb_note (bb);
 
   gcc_assert (NOTE_BASIC_BLOCK (note) == bb
 	      && bb->aux == NULL);
Index: gcc/sel-sched.c
===================================================================
--- gcc/sel-sched.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/sel-sched.c	2015-06-06 11:33:59.784667407 +0100
@@ -4726,11 +4726,10 @@  find_place_for_bookkeeping (edge e1, edg
 find_seqno_for_bookkeeping (insn_t place_to_insert, insn_t join_point)
 {
   int seqno;
-  rtx next;
 
   /* Check if we are about to insert bookkeeping copy before a jump, and use
      jump's seqno for the copy; otherwise, use JOIN_POINT's seqno.  */
-  next = NEXT_INSN (place_to_insert);
+  rtx_insn *next = NEXT_INSN (place_to_insert);
   if (INSN_P (next)
       && JUMP_P (next)
       && BLOCK_FOR_INSN (next) == BLOCK_FOR_INSN (place_to_insert))
@@ -5151,11 +5150,11 @@  find_sequential_best_exprs (bnd_t bnd, e
 static void ATTRIBUTE_UNUSED
 move_nop_to_previous_block (insn_t nop, basic_block prev_bb)
 {
-  insn_t prev_insn, next_insn, note;
+  insn_t prev_insn, next_insn;
 
   gcc_assert (sel_bb_head_p (nop)
               && prev_bb == BLOCK_FOR_INSN (nop)->prev_bb);
-  note = bb_note (BLOCK_FOR_INSN (nop));
+  rtx_note *note = bb_note (BLOCK_FOR_INSN (nop));
   prev_insn = sel_bb_end (prev_bb);
   next_insn = NEXT_INSN (nop);
   gcc_assert (prev_insn != NULL_RTX
@@ -6741,10 +6740,11 @@  move_op (insn_t insn, av_set_t orig_ops,
 init_seqno_1 (basic_block bb, sbitmap visited_bbs, bitmap blocks_to_reschedule)
 {
   int bbi = BLOCK_TO_BB (bb->index);
-  insn_t insn, note = bb_note (bb);
+  insn_t insn;
   insn_t succ_insn;
   succ_iterator si;
 
+  rtx_note *note = bb_note (bb);
   bitmap_set_bit (visited_bbs, bbi);
   if (blocks_to_reschedule)
     bitmap_clear_bit (blocks_to_reschedule, bb->index);
Index: gcc/shrink-wrap.c
===================================================================
--- gcc/shrink-wrap.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/shrink-wrap.c	2015-06-06 11:33:59.784667407 +0100
@@ -813,7 +813,6 @@  try_shrink_wrapping (edge *entry_edge, e
 	    FOR_EACH_BB_REVERSE_FN (bb, cfun)
 	      {
 		basic_block copy_bb, tbb;
-		rtx_insn *insert_point;
 		int eflags;
 
 		if (!bitmap_clear_bit (&bb_tail, bb->index))
@@ -843,8 +842,8 @@  try_shrink_wrapping (edge *entry_edge, e
 		    BB_COPY_PARTITION (copy_bb, bb);
 		  }
 
-		insert_point = emit_note_after (NOTE_INSN_DELETED,
-						BB_END (copy_bb));
+		rtx_note *insert_point = emit_note_after (NOTE_INSN_DELETED,
+							  BB_END (copy_bb));
 		emit_barrier_after (BB_END (copy_bb));
 
 		tbb = bb;
@@ -1008,12 +1007,11 @@  convert_to_simple_return (edge entry_edg
 	  else if (*pdest_bb == NULL)
 	    {
 	      basic_block bb;
-	      rtx_insn *start;
 
 	      bb = create_basic_block (NULL, NULL, exit_pred);
 	      BB_COPY_PARTITION (bb, e->src);
-	      start = emit_jump_insn_after (gen_simple_return (),
-					    BB_END (bb));
+	      rtx_jump_insn *start = emit_jump_insn_after (gen_simple_return (),
+							   BB_END (bb));
 	      JUMP_LABEL (start) = simple_return_rtx;
 	      emit_barrier_after (start);
 
Index: gcc/stmt.c
===================================================================
--- gcc/stmt.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/stmt.c	2015-06-06 11:33:59.788667360 +0100
@@ -980,7 +980,7 @@  emit_case_dispatch_table (tree index_exp
   int i, ncases;
   struct case_node *n;
   rtx *labelvec;
-  rtx fallback_label = label_rtx (case_list->code_label);
+  rtx_insn *fallback_label = label_rtx (case_list->code_label);
   rtx_code_label *table_label = gen_label_rtx ();
   bool has_gaps = false;
   edge default_edge = stmt_bb ? EDGE_SUCC (stmt_bb, 0) : NULL;
Index: gcc/store-motion.c
===================================================================
--- gcc/store-motion.c	2015-06-06 11:33:59.788667360 +0100
+++ gcc/store-motion.c	2015-06-06 11:33:59.788667360 +0100
@@ -304,10 +304,10 @@  store_ops_ok (const_rtx x, int *regs_set
 /* Returns a list of registers mentioned in X.
    FIXME: A regset would be prettier and less expensive.  */
 
-static rtx
+static rtx_expr_list *
 extract_mentioned_regs (rtx x)
 {
-  rtx mentioned_regs = NULL;
+  rtx_expr_list *mentioned_regs = NULL;
   subrtx_var_iterator::array_type array;
   FOR_EACH_SUBRTX_VAR (iter, array, x, NONCONST)
     {