From 1dc90f4eae46213d2b2c8bec05b8f25c30120976 Mon Sep 17 00:00:00 2001
From: David Malcolm <dmalcolm@redhat.com>
Date: Fri, 27 Dec 2013 19:36:58 -0500
Subject: [PATCH 4/5] FIXME: more rtx_code_label

---
 gcc/asan.c                         | 10 +++--
 gcc/bb-reorder.c                   | 17 +++++---
 gcc/cfgexpand.c                    |  2 +-
 gcc/config/aarch64/aarch64.c       |  8 ++--
 gcc/config/alpha/alpha.md          |  4 +-
 gcc/config/arm/arm.c               | 29 ++++++++------
 gcc/config/arm/arm.h               |  4 +-
 gcc/config/avr/avr.md              |  2 +-
 gcc/config/cris/cris.c             |  3 +-
 gcc/config/epiphany/epiphany.md    |  2 +-
 gcc/config/h8300/h8300.c           |  4 +-
 gcc/config/i386/i386.c             | 82 +++++++++++++++++++++-----------------
 gcc/config/i386/i386.md            | 14 +++----
 gcc/config/ia64/ia64.c             |  3 +-
 gcc/config/m32c/m32c.c             |  3 +-
 gcc/config/m32r/m32r.c             |  2 +-
 gcc/config/mcore/mcore.md          |  4 +-
 gcc/config/mep/mep.c               |  3 +-
 gcc/config/microblaze/microblaze.c |  7 ++--
 gcc/config/mips/mips.c             | 18 +++++----
 gcc/config/mips/mips.md            | 16 ++++----
 gcc/config/pa/pa.c                 |  6 +--
 gcc/config/picochip/picochip.c     |  2 +-
 gcc/config/rs6000/rs6000.c         | 19 +++++----
 gcc/config/rs6000/rs6000.md        |  7 ++--
 gcc/config/s390/s390.c             | 36 +++++++++--------
 gcc/config/s390/s390.md            | 28 ++++++-------
 gcc/config/sh/sh-mem.cc            | 10 ++---
 gcc/config/sh/sh.c                 | 31 +++++++-------
 gcc/config/sh/sh.md                |  6 +--
 gcc/config/sparc/sparc.c           | 11 +++--
 gcc/config/spu/spu.c               |  3 +-
 gcc/config/stormy16/stormy16.c     |  4 +-
 gcc/config/tilegx/tilegx.c         |  3 +-
 gcc/config/tilepro/tilepro.c       |  3 +-
 gcc/config/vax/builtins.md         |  6 +--
 gcc/config/xtensa/xtensa.c         |  9 +++--
 gcc/dojump.c                       |  4 +-
 gcc/except.c                       |  9 +++--
 gcc/except.h                       |  2 +-
 gcc/explow.c                       | 20 +++++-----
 gcc/expr.c                         | 20 ++++++----
 gcc/expr.h                         |  6 ++-
 gcc/function.c                     |  2 +-
 gcc/function.h                     |  2 +-
 gcc/internal-fn.c                  | 11 +++--
 gcc/optabs.c                       | 21 +++++-----
 gcc/reorg.c                        |  4 +-
 gcc/stmt.c                         | 20 +++++-----
 49 files changed, 303 insertions(+), 239 deletions(-)

diff --git a/gcc/asan.c b/gcc/asan.c
index 118f9fc..983fe52 100644
--- a/gcc/asan.c
+++ b/gcc/asan.c
@@ -905,7 +905,8 @@ asan_shadow_cst (unsigned char shadow_bytes[4])
 static void
 asan_clear_shadow (rtx shadow_mem, HOST_WIDE_INT len)
 {
-  rtx insn, insns, top_label, end, addr, tmp, jump;
+  rtx insn, insns, end, addr, tmp, jump;
+  rtx_code_label *top_label;
 
   start_sequence ();
   clear_storage (shadow_mem, GEN_INT (len), BLOCK_OP_NORMAL);
@@ -964,7 +965,8 @@ rtx
 asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb,
 			    HOST_WIDE_INT *offsets, tree *decls, int length)
 {
-  rtx shadow_base, shadow_mem, ret, mem, orig_base, lab;
+  rtx shadow_base, shadow_mem, ret, mem, orig_base;
+  rtx_code_label *lab;
   char buf[30];
   unsigned char shadow_bytes[4];
   HOST_WIDE_INT base_offset = offsets[length - 1];
@@ -1154,10 +1156,10 @@ asan_emit_stack_protection (rtx base, rtx pbase, unsigned int alignb,
   /* Construct epilogue sequence.  */
   start_sequence ();
 
-  lab = NULL_RTX;  
+  lab = NULL_RTX_CODE_LABEL;
   if (use_after_return_class != -1)
     {
-      rtx lab2 = gen_label_rtx ();
+      rtx_code_label *lab2 = gen_label_rtx ();
       char c = (char) ASAN_STACK_MAGIC_USE_AFTER_RET;
       int very_likely = REG_BR_PROB_BASE - (REG_BR_PROB_BASE / 2000 - 1);
       emit_cmp_and_jump_insns (orig_base, base, EQ, NULL_RTX,
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index f16f57b..aed4d04 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -1370,10 +1370,12 @@ copy_bb_p (const_basic_block bb, int code_may_grow)
 int
 get_uncond_jump_length (void)
 {
-  rtx label, jump;
+  rtx_code_label *label;
+  rtx jump;
   int length;
 
-  label = emit_label_before (gen_label_rtx (), get_insns ());
+  label = emit_label_before (gen_label_rtx (),
+			     get_insns ());
   jump = emit_jump_insn (gen_jump (label));
 
   length = get_attr_min_length (jump);
@@ -1392,7 +1394,9 @@ fix_up_crossing_landing_pad (eh_landing_pad old_lp, basic_block old_bb)
 {
   eh_landing_pad new_lp;
   basic_block new_bb, last_bb, post_bb;
-  rtx new_label, jump, post_label;
+  rtx new_label;
+  rtx_code_label *post_label;
+  rtx jump;
   unsigned new_partition;
   edge_iterator ei;
   edge e;
@@ -1731,7 +1735,8 @@ add_labels_and_missing_jumps (vec<edge> crossing_edges)
     {
       basic_block src = e->src;
       basic_block dest = e->dest;
-      rtx label, new_jump;
+      rtx_code_label *label;
+      rtx new_jump;
 
       if (dest == EXIT_BLOCK_PTR_FOR_FN (cfun))
 	continue;
@@ -1789,7 +1794,7 @@ fix_up_fall_thru_edges (void)
   bool cond_jump_crosses;
   int invert_worked;
   rtx old_jump;
-  rtx fall_thru_label;
+  rtx_code_label *fall_thru_label;
 
   FOR_EACH_BB_FN (cur_bb, cfun)
     {
@@ -1988,7 +1993,7 @@ fix_crossing_conditional_branches (void)
   rtx old_jump;
   rtx set_src;
   rtx old_label = NULL_RTX;
-  rtx new_label;
+  rtx_code_label *new_label;
 
   FOR_EACH_BB_FN (cur_bb, cfun)
     {
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 39f9895..2c45395 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2453,7 +2453,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
   enum machine_mode *inout_mode = XALLOCAVEC (enum machine_mode, noutputs);
   const char **constraints = XALLOCAVEC (const char *, noutputs + ninputs);
   int old_generating_concat_p = generating_concat_p;
-  rtx fallthru_label = NULL_RTX;
+  rtx_code_label *fallthru_label = NULL_RTX_CODE_LABEL;
 
   /* An ASM with no outputs needs to be treated as volatile, for now.  */
   if (noutputs == 0)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index c2f6c4f..2e66565 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -8294,7 +8294,8 @@ aarch64_split_compare_and_swap (rtx operands[])
   rtx rval, mem, oldval, newval, scratch;
   enum machine_mode mode;
   bool is_weak;
-  rtx label1, label2, x, cond;
+  rtx_code_label *label1, *label2;
+  rtx x, cond;
 
   rval = operands[0];
   mem = operands[1];
@@ -8304,7 +8305,7 @@ aarch64_split_compare_and_swap (rtx operands[])
   scratch = operands[7];
   mode = GET_MODE (mem);
 
-  label1 = NULL_RTX;
+  label1 = NULL_RTX_CODE_LABEL;
   if (!is_weak)
     {
       label1 = gen_label_rtx ();
@@ -8347,7 +8348,8 @@ aarch64_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
 {
   enum machine_mode mode = GET_MODE (mem);
   enum machine_mode wmode = (mode == DImode ? DImode : SImode);
-  rtx label, x;
+  rtx_code_label *label;
+  rtx x;
 
   label = gen_label_rtx ();
   emit_label (label);
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 795b4df..3348cf5 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -4907,8 +4907,8 @@
     }
   else
     {
-      rtx out_label = 0;
-      rtx loop_label = gen_label_rtx ();
+      rtx_code_label *out_label = 0;
+      rtx_code_label *loop_label = gen_label_rtx ();
       rtx want = gen_reg_rtx (Pmode);
       rtx tmp = gen_reg_rtx (Pmode);
       rtx memref, test;
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index ccad548..7a5123b 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -707,7 +707,7 @@ int arm_fpu_attr;
 const struct arm_fpu_desc *arm_fpu_desc;
 
 /* Used for Thumb call_via trampolines.  */
-rtx thumb_call_via_label[14];
+rtx_code_label *thumb_call_via_label[14];
 static int thumb_call_reg_needed;
 
 /* Bit values used to identify processor capabilities.  */
@@ -14376,7 +14376,8 @@ arm_block_move_unaligned_loop (rtx dest, rtx src, HOST_WIDE_INT length,
 			       unsigned int interleave_factor,
 			       HOST_WIDE_INT bytes_per_iter)
 {
-  rtx label, src_reg, dest_reg, final_src, test;
+  rtx_code_label *label;
+  rtx src_reg, dest_reg, final_src, test;
   HOST_WIDE_INT leftover;
   
   leftover = length % bytes_per_iter;
@@ -15994,7 +15995,7 @@ struct minipool_fixup
 
 static Mnode *	minipool_vector_head;
 static Mnode *	minipool_vector_tail;
-static rtx	minipool_vector_label;
+static rtx_code_label *minipool_vector_label;
 static int	minipool_pad;
 
 /* The linked list of all minipool fixes required for this function.  */
@@ -16589,7 +16590,7 @@ create_fix_barrier (Mfix *fix, HOST_WIDE_INT max_address)
   HOST_WIDE_INT selected_address;
   Mfix * new_fix;
   HOST_WIDE_INT max_count = max_address - fix->address;
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
 
   selected_cost = arm_barrier_cost (from);
   selected_address = fix->address;
@@ -19495,7 +19496,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
 	 of call_reg and call_value_reg type insns.  */
       for (regno = 0; regno < LR_REGNUM; regno++)
 	{
-	  rtx label = cfun->machine->call_via[regno];
+	  rtx_code_label *label = cfun->machine->call_via[regno];
 
 	  if (label != NULL)
 	    {
@@ -27871,7 +27872,7 @@ const char *
 thumb_call_via_reg (rtx reg)
 {
   int regno = REGNO (reg);
-  rtx *labelp;
+  rtx_code_label **labelp;
 
   gcc_assert (regno < LR_REGNUM);
 
@@ -27893,7 +27894,7 @@ thumb_call_via_reg (rtx reg)
       labelp = cfun->machine->call_via + regno;
     }
 
-  output_asm_insn ("bl\t%a0", labelp);
+  output_asm_insn ("bl\t%a0", (rtx *)labelp);
   return "";
 }
 
@@ -28162,7 +28163,7 @@ arm_file_end (void)
 
   for (regno = 0; regno < LR_REGNUM; regno++)
     {
-      rtx label = thumb_call_via_label[regno];
+      rtx_code_label *label = thumb_call_via_label[regno];
 
       if (label != 0)
 	{
@@ -30145,7 +30146,8 @@ arm_split_compare_and_swap (rtx operands[])
   enum machine_mode mode;
   enum memmodel mod_s, mod_f;
   bool is_weak;
-  rtx label1, label2, x, cond;
+  rtx_code_label *label1, *label2;
+  rtx x, cond;
 
   rval = operands[0];
   mem = operands[1];
@@ -30171,7 +30173,7 @@ arm_split_compare_and_swap (rtx operands[])
   if (!(use_acquire || use_release))
     arm_pre_atomic_barrier (mod_s);
 
-  label1 = NULL_RTX;
+  label1 = NULL_RTX_CODE_LABEL;
   if (!is_weak)
     {
       label1 = gen_label_rtx ();
@@ -30221,7 +30223,8 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
   enum memmodel model = (enum memmodel) INTVAL (model_rtx);
   enum machine_mode mode = GET_MODE (mem);
   enum machine_mode wmode = (mode == DImode ? DImode : SImode);
-  rtx label, x;
+  rtx_code_label *label;
+  rtx x;
 
   bool use_acquire = TARGET_HAVE_LDACQ
                      && !(model == MEMMODEL_RELAXED
@@ -31147,7 +31150,7 @@ arm_emit_coreregs_64bit_shift (enum rtx_code code, rtx out, rtx in,
 			  ORR (SHIFT (ASHIFT, in_up, scratch1), out_down)));
 	  if (code == ASHIFTRT)
 	    {
-	      rtx done_label = gen_label_rtx ();
+	      rtx_code_label *done_label = gen_label_rtx ();
 	      emit_jump_insn (BRANCH (LT, done_label));
 	      emit_insn (SET (out_down, ORR (SHIFT (ASHIFTRT, in_up, scratch2),
 					     out_down)));
@@ -31166,7 +31169,7 @@ arm_emit_coreregs_64bit_shift (enum rtx_code code, rtx out, rtx in,
 
 	  if (code == ASHIFTRT)
 	    {
-	      rtx done_label = gen_label_rtx ();
+	      rtx_code_label *done_label = gen_label_rtx ();
 	      emit_jump_insn (BRANCH (LT, done_label));
 	      emit_insn (SET (scratch2, SHIFT (ASHIFTRT, in_up, scratch2)));
 	      emit_insn (SET (out_down, ORR (out_down, scratch2)));
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 56da311..507ae0c 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1536,7 +1536,7 @@ typedef struct GTY(()) machine_function
   /* Labels for per-function Thumb call-via stubs.  One per potential calling
      register.  We can never call via LR or PC.  We can call via SP if a
      trampoline happens to be on the top of the stack.  */
-  rtx call_via[14];
+  rtx_code_label *call_via[14];
   /* Set to 1 when a return insn is output, this means that the epilogue
      is not needed.  */
   int return_used_this_function;
@@ -1555,7 +1555,7 @@ machine_function;
 
 /* As in the machine_function, a global set of call-via labels, for code 
    that is in text_section.  */
-extern GTY(()) rtx thumb_call_via_label[14];
+extern GTY(()) rtx_code_label *thumb_call_via_label[14];
 
 /* The number of potential ways of assigning to a co-processor.  */
 #define ARM_NUM_COPROC_SLOTS 1
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index 2c59bf3..4399e6c 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -5609,7 +5609,7 @@
               (match_operand:PSI 1 "register_operand" "")])]
   ""
   {
-    rtx label = gen_label_rtx ();
+    rtx_code_label *label = gen_label_rtx ();
     emit (gen_flash_segment1 (operands[0], operands[1], label));
     emit_label (label);
     DONE;
diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c
index 194dd14..abd5d3c 100644
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -1987,7 +1987,8 @@ cris_simple_epilogue (void)
 void
 cris_emit_trap_for_misalignment (rtx mem)
 {
-  rtx addr, reg, ok_label, andop, jmp;
+  rtx addr, reg, andop, jmp;
+  rtx_code_label *ok_label;
   int natural_alignment;
   gcc_assert (MEM_P (mem));
 
diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md
index d8d5555..1a2f5d3 100644
--- a/gcc/config/epiphany/epiphany.md
+++ b/gcc/config/epiphany/epiphany.md
@@ -976,7 +976,7 @@
       REAL_VALUE_TYPE offset;
       rtx limit;
       rtx tmp = gen_reg_rtx (SFmode);
-      rtx label = gen_label_rtx ();
+      rtx_code_label *label = gen_label_rtx ();
       rtx bit31;
       rtx cc1 = gen_rtx_REG (CC_FPmode, CCFP_REGNUM);
       rtx cmp = gen_rtx_LT (VOIDmode, cc1, CONST0_RTX (SFmode));
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index e7ed03a..f0f7d54 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -4977,8 +4977,8 @@ expand_a_rotate (rtx operands[])
   if (GET_CODE (rotate_amount) != CONST_INT)
     {
       rtx counter = gen_reg_rtx (QImode);
-      rtx start_label = gen_label_rtx ();
-      rtx end_label = gen_label_rtx ();
+      rtx_code_label *start_label = gen_label_rtx ();
+      rtx_code_label *end_label = gen_label_rtx ();
 
       /* If the rotate amount is less than or equal to 0,
 	 we go out of the loop.  */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 24c6f82..4b0d4a6 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -8239,7 +8239,8 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
   if (ix86_varargs_fpr_size)
     {
       enum machine_mode smode;
-      rtx label, test;
+      rtx_code_label *label;
+      rtx test;
 
       /* Now emit code to save SSE registers.  The AX parameter contains number
 	 of SSE parameter registers used to call this function, though all we
@@ -11188,7 +11189,8 @@ ix86_expand_prologue (void)
 	{
 	  if (ix86_cmodel == CM_LARGE_PIC)
 	    {
-	      rtx label, tmp_reg;
+	      rtx_code_label *label;
+	      rtx tmp_reg;
 
 	      gcc_assert (Pmode == DImode);
 	      label = gen_label_rtx ();
@@ -11879,9 +11881,10 @@ ix86_expand_split_stack_prologue (void)
   struct ix86_frame frame;
   HOST_WIDE_INT allocate;
   unsigned HOST_WIDE_INT args_size;
-  rtx label, limit, current, jump_insn, allocate_rtx, call_insn, call_fusage;
+  rtx_code_label *label;
+  rtx limit, current, jump_insn, allocate_rtx, call_insn, call_fusage;
   rtx scratch_reg = NULL_RTX;
-  rtx varargs_label = NULL_RTX;
+  rtx_code_label *varargs_label = NULL_RTX_CODE_LABEL;
   rtx fn;
 
   gcc_assert (flag_split_stack && reload_completed);
@@ -11997,7 +12000,8 @@ ix86_expand_split_stack_prologue (void)
 
 	  if (ix86_cmodel == CM_LARGE_PIC)
 	    {
-	      rtx label, x;
+	      rtx_code_label *label;
+	      rtx x;
 
 	      label = gen_label_rtx ();
 	      emit_label (label);
@@ -17644,7 +17648,7 @@ void
 ix86_split_idivmod (enum machine_mode mode, rtx operands[],
 		    bool signed_p)
 {
-  rtx end_label, qimode_label;
+  rtx_code_label *end_label, *qimode_label;
   rtx insn, div, mod;
   rtx scratch, tmp0, tmp1, tmp2;
   rtx (*gen_divmod4_1) (rtx, rtx, rtx, rtx);
@@ -19906,7 +19910,8 @@ ix86_expand_branch (enum rtx_code code, rtx op0, rtx op1, rtx label)
     case TImode:
       /* Expand DImode branch into multiple compare+branch.  */
       {
-	rtx lo[2], hi[2], label2;
+	rtx lo[2], hi[2];
+	rtx_code_label *label2;
 	enum rtx_code code1, code2, code3;
 	enum machine_mode submode;
 
@@ -22715,10 +22720,10 @@ predict_jump (int prob)
 
 /* Helper function for the string operations below.  Dest VARIABLE whether
    it is aligned to VALUE bytes.  If true, jump to the label.  */
-static rtx
+static rtx_code_label *
 ix86_expand_aligntest (rtx variable, int value, bool epilogue)
 {
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
   rtx tmpcount = gen_reg_rtx (GET_MODE (variable));
   if (GET_MODE (variable) == DImode)
     emit_insn (gen_anddi3 (tmpcount, variable, GEN_INT (value)));
@@ -22813,7 +22818,8 @@ expand_set_or_movmem_via_loop (rtx destmem, rtx srcmem,
 			       rtx count, enum machine_mode mode, int unroll,
 			       int expected_size, bool issetmem)
 {
-  rtx out_label, top_label, iter, tmp;
+  rtx_code_label *out_label, *top_label;
+  rtx iter, tmp;
   enum machine_mode iter_mode = counter_mode (count);
   int piece_size_n = GET_MODE_SIZE (mode) * unroll;
   rtx piece_size = GEN_INT (piece_size_n);
@@ -23130,7 +23136,7 @@ expand_movmem_epilogue (rtx destmem, rtx srcmem,
     {
       if (max_size > 4)
 	{
-	  rtx label = ix86_expand_aligntest (count, 4, true);
+	  rtx_code_label *label = ix86_expand_aligntest (count, 4, true);
 	  src = change_address (srcmem, SImode, srcptr);
 	  dest = change_address (destmem, SImode, destptr);
 	  emit_insn (gen_strmov (destptr, dest, srcptr, src));
@@ -23139,7 +23145,7 @@ expand_movmem_epilogue (rtx destmem, rtx srcmem,
 	}
       if (max_size > 2)
 	{
-	  rtx label = ix86_expand_aligntest (count, 2, true);
+	  rtx_code_label *label = ix86_expand_aligntest (count, 2, true);
 	  src = change_address (srcmem, HImode, srcptr);
 	  dest = change_address (destmem, HImode, destptr);
 	  emit_insn (gen_strmov (destptr, dest, srcptr, src));
@@ -23148,7 +23154,7 @@ expand_movmem_epilogue (rtx destmem, rtx srcmem,
 	}
       if (max_size > 1)
 	{
-	  rtx label = ix86_expand_aligntest (count, 1, true);
+	  rtx_code_label *label = ix86_expand_aligntest (count, 1, true);
 	  src = change_address (srcmem, QImode, srcptr);
 	  dest = change_address (destmem, QImode, destptr);
 	  emit_insn (gen_strmov (destptr, dest, srcptr, src));
@@ -23163,7 +23169,7 @@ expand_movmem_epilogue (rtx destmem, rtx srcmem,
 
       if (max_size > 4)
 	{
-	  rtx label = ix86_expand_aligntest (count, 4, true);
+	  rtx_code_label *label = ix86_expand_aligntest (count, 4, true);
 	  src = change_address (srcmem, SImode, srcptr);
 	  dest = change_address (destmem, SImode, destptr);
 	  emit_move_insn (dest, src);
@@ -23176,7 +23182,7 @@ expand_movmem_epilogue (rtx destmem, rtx srcmem,
 	}
       if (max_size > 2)
 	{
-	  rtx label = ix86_expand_aligntest (count, 2, true);
+	  rtx_code_label *label = ix86_expand_aligntest (count, 2, true);
 	  tmp = gen_rtx_PLUS (Pmode, srcptr, offset);
 	  src = change_address (srcmem, HImode, tmp);
 	  tmp = gen_rtx_PLUS (Pmode, destptr, offset);
@@ -23191,7 +23197,7 @@ expand_movmem_epilogue (rtx destmem, rtx srcmem,
 	}
       if (max_size > 1)
 	{
-	  rtx label = ix86_expand_aligntest (count, 1, true);
+	  rtx_code_label *label = ix86_expand_aligntest (count, 1, true);
 	  tmp = gen_rtx_PLUS (Pmode, srcptr, offset);
 	  src = change_address (srcmem, QImode, tmp);
 	  tmp = gen_rtx_PLUS (Pmode, destptr, offset);
@@ -23307,7 +23313,7 @@ expand_setmem_epilogue (rtx destmem, rtx destptr, rtx value, rtx vec_value,
     }
   if (max_size > 16)
     {
-      rtx label = ix86_expand_aligntest (count, 16, true);
+      rtx_code_label *label = ix86_expand_aligntest (count, 16, true);
       if (TARGET_64BIT)
 	{
 	  dest = change_address (destmem, DImode, destptr);
@@ -23331,7 +23337,7 @@ expand_setmem_epilogue (rtx destmem, rtx destptr, rtx value, rtx vec_value,
     }
   if (max_size > 8)
     {
-      rtx label = ix86_expand_aligntest (count, 8, true);
+      rtx_code_label *label = ix86_expand_aligntest (count, 8, true);
       if (TARGET_64BIT)
 	{
 	  dest = change_address (destmem, DImode, destptr);
@@ -23349,7 +23355,7 @@ expand_setmem_epilogue (rtx destmem, rtx destptr, rtx value, rtx vec_value,
     }
   if (max_size > 4)
     {
-      rtx label = ix86_expand_aligntest (count, 4, true);
+      rtx_code_label *label = ix86_expand_aligntest (count, 4, true);
       dest = change_address (destmem, SImode, destptr);
       emit_insn (gen_strset (destptr, dest, gen_lowpart (SImode, value)));
       emit_label (label);
@@ -23357,7 +23363,7 @@ expand_setmem_epilogue (rtx destmem, rtx destptr, rtx value, rtx vec_value,
     }
   if (max_size > 2)
     {
-      rtx label = ix86_expand_aligntest (count, 2, true);
+      rtx_code_label *label = ix86_expand_aligntest (count, 2, true);
       dest = change_address (destmem, HImode, destptr);
       emit_insn (gen_strset (destptr, dest, gen_lowpart (HImode, value)));
       emit_label (label);
@@ -23365,7 +23371,7 @@ expand_setmem_epilogue (rtx destmem, rtx destptr, rtx value, rtx vec_value,
     }
   if (max_size > 1)
     {
-      rtx label = ix86_expand_aligntest (count, 1, true);
+      rtx_code_label *label = ix86_expand_aligntest (count, 1, true);
       dest = change_address (destmem, QImode, destptr);
       emit_insn (gen_strset (destptr, dest, gen_lowpart (QImode, value)));
       emit_label (label);
@@ -23389,7 +23395,7 @@ expand_set_or_movmem_prologue (rtx destmem, rtx srcmem,
     {
       if (align <= i)
 	{
-	  rtx label = ix86_expand_aligntest (destptr, i, false);
+	  rtx_code_label *label = ix86_expand_aligntest (destptr, i, false);
 	  if (issetmem)
 	    {
 	      if (vec_value && i > GET_MODE_SIZE (GET_MODE (value)))
@@ -23418,7 +23424,7 @@ expand_small_movmem_or_setmem (rtx destmem, rtx srcmem,
 			       rtx count, int size,
 			       rtx done_label, bool issetmem)
 {
-  rtx label = ix86_expand_aligntest (count, size, false);
+  rtx_code_label *label = ix86_expand_aligntest (count, size, false);
   enum machine_mode mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 1);
   rtx modesize;
   int n;
@@ -23543,7 +23549,7 @@ expand_set_or_movmem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx src
 							    enum machine_mode mode,
 							    rtx value, rtx vec_value,
 							    rtx *count,
-							    rtx *done_label,
+							    rtx_code_label **done_label,
 							    int size,
 							    int desired_align,
 							    int align,
@@ -23551,7 +23557,7 @@ expand_set_or_movmem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx src
 							    bool dynamic_check,
 							    bool issetmem)
 {
-  rtx loop_label = NULL, label;
+  rtx_code_label *loop_label = NULL, *label;
   int n;
   rtx modesize;
   int prolog_size = 0;
@@ -24149,9 +24155,9 @@ ix86_expand_set_or_movmem (rtx dst, rtx src, rtx count_exp, rtx val_exp,
 {
   rtx destreg;
   rtx srcreg = NULL;
-  rtx label = NULL;
+  rtx_code_label *label = NULL;
   rtx tmp;
-  rtx jump_around_label = NULL;
+  rtx_code_label *jump_around_label = NULL;
   HOST_WIDE_INT align = 1;
   unsigned HOST_WIDE_INT count = 0;
   HOST_WIDE_INT expected_size = -1;
@@ -24425,7 +24431,7 @@ ix86_expand_set_or_movmem (rtx dst, rtx src, rtx count_exp, rtx val_exp,
 	}
       else
 	{
-	  rtx hot_label = gen_label_rtx ();
+	  rtx_code_label *hot_label = gen_label_rtx ();
 	  if (jump_around_label == NULL_RTX)
 	    jump_around_label = gen_label_rtx ();
 	  emit_cmp_and_jump_insns (count_exp, GEN_INT (dynamic_check - 1),
@@ -24623,10 +24629,10 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx src, rtx align_rtx)
 {
   int align;
   rtx tmp;
-  rtx align_2_label = NULL_RTX;
-  rtx align_3_label = NULL_RTX;
-  rtx align_4_label = gen_label_rtx ();
-  rtx end_0_label = gen_label_rtx ();
+  rtx_code_label *align_2_label = NULL_RTX_CODE_LABEL;
+  rtx_code_label *align_3_label = NULL_RTX_CODE_LABEL;
+  rtx_code_label *align_4_label = gen_label_rtx ();
+  rtx_code_label *end_0_label = gen_label_rtx ();
   rtx mem;
   rtx tmpreg = gen_reg_rtx (SImode);
   rtx scratch = gen_reg_rtx (SImode);
@@ -39477,7 +39483,8 @@ x86_maybe_negate_const_int (rtx *loc, enum machine_mode mode)
 void
 x86_emit_floatuns (rtx operands[2])
 {
-  rtx neglab, donelab, i0, i1, f0, in, out;
+  rtx_code_label *neglab, *donelab;
+  rtx i0, i1, f0, in, out;
   enum machine_mode mode, inmode;
 
   inmode = GET_MODE (operands[1]);
@@ -41264,8 +41271,8 @@ ix86_emit_fp_unordered_jump (rtx label)
 
 void ix86_emit_i387_log1p (rtx op0, rtx op1)
 {
-  rtx label1 = gen_label_rtx ();
-  rtx label2 = gen_label_rtx ();
+  rtx_code_label *label1 = gen_label_rtx ();
+  rtx_code_label *label2 = gen_label_rtx ();
 
   rtx tmp = gen_reg_rtx (XFmode);
   rtx tmp2 = gen_reg_rtx (XFmode);
@@ -41299,7 +41306,7 @@ void ix86_emit_i387_round (rtx op0, rtx op1)
   rtx e1, e2, res, tmp, tmp1, half;
   rtx scratch = gen_reg_rtx (HImode);
   rtx flags = gen_rtx_REG (CCNOmode, FLAGS_REG);
-  rtx jump_label = gen_label_rtx ();
+  rtx_code_label *jump_label = gen_label_rtx ();
   rtx insn;
   rtx (*gen_abs) (rtx, rtx);
   rtx (*gen_neg) (rtx, rtx);
@@ -41740,7 +41747,8 @@ ix86_expand_sse_compare_and_jump (enum rtx_code code, rtx op0, rtx op1,
                                   bool swap_operands)
 {
   enum machine_mode fpcmp_mode = ix86_fp_compare_mode (code);
-  rtx label, tmp;
+  rtx_code_label *label;
+  rtx tmp;
 
   if (swap_operands)
     {
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 44e80ec..576ae7b 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -9062,7 +9062,7 @@
    (use (match_operand:QI 2 "register_operand"))]
   ""
 {
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
   rtx tmp;
 
   emit_insn (gen_testqi_ccz_1 (operands[2],
@@ -9725,7 +9725,7 @@
    (use (match_operand:QI 2 "register_operand"))]
   ""
 {
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
   rtx tmp;
 
   emit_insn (gen_testqi_ccz_1 (operands[2],
@@ -13456,7 +13456,7 @@
    (use (match_operand:XF 2 "general_operand"))]
   "TARGET_USE_FANCY_MATH_387"
 {
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
 
   rtx op1 = gen_reg_rtx (XFmode);
   rtx op2 = gen_reg_rtx (XFmode);
@@ -13481,7 +13481,7 @@
 {
   rtx (*gen_truncxf) (rtx, rtx);
 
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
 
   rtx op1 = gen_reg_rtx (XFmode);
   rtx op2 = gen_reg_rtx (XFmode);
@@ -13527,7 +13527,7 @@
    (use (match_operand:XF 2 "general_operand"))]
   "TARGET_USE_FANCY_MATH_387"
 {
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
 
   rtx op1 = gen_reg_rtx (XFmode);
   rtx op2 = gen_reg_rtx (XFmode);
@@ -13552,7 +13552,7 @@
 {
   rtx (*gen_truncxf) (rtx, rtx);
 
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
 
   rtx op1 = gen_reg_rtx (XFmode);
   rtx op2 = gen_reg_rtx (XFmode);
@@ -18144,7 +18144,7 @@
 	(unspec_volatile:SI [(const_int 0)] UNSPECV_XBEGIN))]
   "TARGET_RTM"
 {
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
 
   /* xbegin is emitted as jump_insn, so reload won't be able
      to reload its operand.  Force the value into AX hard register.  */
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 118e5bf..d60cb8c 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -2319,7 +2319,8 @@ ia64_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
 		       rtx old_dst, rtx new_dst, enum memmodel model)
 {
   enum machine_mode mode = GET_MODE (mem);
-  rtx old_reg, new_reg, cmp_reg, ar_ccv, label;
+  rtx old_reg, new_reg, cmp_reg, ar_ccv;
+  rtx_code_label *label;
   enum insn_code icode;
 
   /* Special case for using fetchadd.  */
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 75f67f7..39212c6 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -3819,7 +3819,8 @@ m32c_prepare_shift (rtx * operands, int scale, int shift_code)
 	 undefined to skip one of the comparisons.  */
 
       rtx count;
-      rtx label, insn, tempvar;
+      rtx_code_label *label;
+      rtx insn, tempvar;
 
       emit_move_insn (operands[0], operands[1]);
 
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index 2b84b0f..fc0c0d1 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -2539,7 +2539,7 @@ m32r_expand_block_move (rtx operands[])
   /* If necessary, generate a loop to handle the bulk of the copy.  */
   if (bytes)
     {
-      rtx label = NULL_RTX;
+      rtx_code_label *label = NULL_RTX_CODE_LABEL;
       rtx final_src = NULL_RTX;
       rtx at_a_time = GEN_INT (MAX_MOVE_BYTES);
       rtx rounded_total = GEN_INT (bytes);
diff --git a/gcc/config/mcore/mcore.md b/gcc/config/mcore/mcore.md
index a65747d..5b49136 100644
--- a/gcc/config/mcore/mcore.md
+++ b/gcc/config/mcore/mcore.md
@@ -3007,8 +3007,8 @@
     }
   else
     {
-      rtx out_label = 0;
-      rtx loop_label = gen_label_rtx ();
+      rtx_code_label *out_label = 0;
+      rtx_code_label *loop_label = gen_label_rtx ();
       rtx step = gen_reg_rtx (Pmode);
       rtx tmp = gen_reg_rtx (Pmode);
       rtx test, memref;
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index 0dc16c7..fa5d21e 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -5476,7 +5476,8 @@ mep_invertable_branch_p (rtx insn)
 static void
 mep_invert_branch (rtx insn, rtx after)
 {
-  rtx cond, set, label;
+  rtx cond, set;
+  rtx_code_label *label;
   int i;
 
   set = PATTERN (insn);
diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
index b12b7bf..54f43a3 100644
--- a/gcc/config/microblaze/microblaze.c
+++ b/gcc/config/microblaze/microblaze.c
@@ -1143,7 +1143,8 @@ microblaze_adjust_block_mem (rtx mem, HOST_WIDE_INT length,
 static void
 microblaze_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length)
 {
-  rtx label, src_reg, dest_reg, final_src;
+  rtx_code_label *label;
+  rtx src_reg, dest_reg, final_src;
   HOST_WIDE_INT leftover;
 
   leftover = length % MAX_MOVE_BYTES;
@@ -3429,8 +3430,8 @@ microblaze_expand_divide (rtx operands[])
   rtx regt1 = gen_reg_rtx (SImode); 
   rtx reg18 = gen_rtx_REG (SImode, R_TMP);
   rtx regqi = gen_reg_rtx (QImode);
-  rtx div_label = gen_label_rtx ();
-  rtx div_end_label = gen_label_rtx ();
+  rtx_code_label *div_label = gen_label_rtx ();
+  rtx_code_label *div_end_label = gen_label_rtx ();
   rtx div_table_rtx = gen_rtx_SYMBOL_REF (QImode,"_divsi3_table");
   rtx mem_rtx;
   rtx ret;
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 17af1d6..d5960a7 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -7383,7 +7383,8 @@ static void
 mips_block_move_loop (rtx dest, rtx src, HOST_WIDE_INT length,
 		      HOST_WIDE_INT bytes_per_iter)
 {
-  rtx label, src_reg, dest_reg, final_src, test;
+  rtx_code_label *label;
+  rtx src_reg, dest_reg, final_src, test;
   HOST_WIDE_INT leftover;
 
   leftover = length % bytes_per_iter;
@@ -7449,7 +7450,8 @@ mips_expand_block_move (rtx dest, rtx src, rtx length)
 void
 mips_expand_synci_loop (rtx begin, rtx end)
 {
-  rtx inc, label, end_label, cmp_result, mask, length;
+  rtx_code_label *label, *end_label;
+  rtx inc, cmp_result, mask, length;
 
   /* Create end_label.  */
   end_label = gen_label_rtx ();
@@ -14494,7 +14496,7 @@ static rtx
 mips_builtin_branch_and_move (rtx condition, rtx target,
 			      rtx value_if_true, rtx value_if_false)
 {
-  rtx true_label, done_label;
+  rtx_code_label *true_label, *done_label;
 
   true_label = gen_label_rtx ();
   done_label = gen_label_rtx ();
@@ -14634,7 +14636,7 @@ mips_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
 struct mips16_constant {
   struct mips16_constant *next;
   rtx value;
-  rtx label;
+  rtx_code_label *label;
   enum machine_mode mode;
 };
 
@@ -14892,7 +14894,8 @@ mips16_lay_out_constants (bool split_p)
 	     do it immediately before INSN.  */
 	  if (barrier == 0 && pool.insn_address + 4 > pool.highest_address)
 	    {
-	      rtx label, jump;
+	      rtx_code_label *label;
+	      rtx jump;
 
 	      label = gen_label_rtx ();
 
@@ -16441,7 +16444,8 @@ mips16_split_long_branches (void)
 	    && get_attr_length (insn) > 4
 	    && (any_condjump_p (insn) || any_uncondjump_p (insn)))
 	  {
-	    rtx old_label, new_label, temp, saved_temp;
+	    rtx_code_label *new_label;
+	    rtx old_label, temp, saved_temp;
 	    rtx target, jump, jump_sequence;
 
 	    start_sequence ();
@@ -16469,7 +16473,7 @@ mips16_split_long_branches (void)
 
 	    if (simplejump_p (insn))
 	      /* We're going to replace INSN with a longer form.  */
-	      new_label = NULL_RTX;
+	      new_label = NULL_RTX_CODE_LABEL;
 	    else
 	      {
 		/* Create a branch-around label for the original
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index f914ab6..5fb8cfe 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -3690,8 +3690,8 @@
   rtx reg1 = gen_reg_rtx (DFmode);
   rtx reg2 = gen_reg_rtx (DFmode);
   rtx reg3 = gen_reg_rtx (SImode);
-  rtx label1 = gen_label_rtx ();
-  rtx label2 = gen_label_rtx ();
+  rtx_code_label *label1 = gen_label_rtx ();
+  rtx_code_label *label2 = gen_label_rtx ();
   rtx test;
   REAL_VALUE_TYPE offset;
 
@@ -3736,8 +3736,8 @@
   rtx reg1 = gen_reg_rtx (DFmode);
   rtx reg2 = gen_reg_rtx (DFmode);
   rtx reg3 = gen_reg_rtx (DImode);
-  rtx label1 = gen_label_rtx ();
-  rtx label2 = gen_label_rtx ();
+  rtx_code_label *label1 = gen_label_rtx ();
+  rtx_code_label *label2 = gen_label_rtx ();
   rtx test;
   REAL_VALUE_TYPE offset;
 
@@ -3779,8 +3779,8 @@
   rtx reg1 = gen_reg_rtx (SFmode);
   rtx reg2 = gen_reg_rtx (SFmode);
   rtx reg3 = gen_reg_rtx (SImode);
-  rtx label1 = gen_label_rtx ();
-  rtx label2 = gen_label_rtx ();
+  rtx_code_label *label1 = gen_label_rtx ();
+  rtx_code_label *label2 = gen_label_rtx ();
   rtx test;
   REAL_VALUE_TYPE offset;
 
@@ -3822,8 +3822,8 @@
   rtx reg1 = gen_reg_rtx (SFmode);
   rtx reg2 = gen_reg_rtx (SFmode);
   rtx reg3 = gen_reg_rtx (DImode);
-  rtx label1 = gen_label_rtx ();
-  rtx label2 = gen_label_rtx ();
+  rtx_code_label *label1 = gen_label_rtx ();
+  rtx_code_label *label2 = gen_label_rtx ();
   rtx test;
   REAL_VALUE_TYPE offset;
 
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 95dcbb9..d6816b8 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -222,7 +222,7 @@ static unsigned int last_address;
    output time.  They are output after the current function.  */
 struct GTY(()) deferred_plabel
 {
-  rtx internal_label;
+  rtx_code_label *internal_label;
   rtx symbol;
 };
 static GTY((length ("n_deferred_plabels"))) struct deferred_plabel *
@@ -4455,7 +4455,7 @@ hppa_profile_hook (int label_no)
      64-bit code to avoid having to provide DImode versions of the
      lcla2 and load_offset_label_address insn patterns.  */
   rtx reg = gen_reg_rtx (SImode);
-  rtx label_rtx = gen_label_rtx ();
+  rtx_code_label *label_rtx = gen_label_rtx ();
   rtx begin_label_rtx, call_insn;
   char begin_label_name[16];
 
@@ -4550,7 +4550,7 @@ hppa_profile_hook (int label_no)
 rtx
 pa_return_addr_rtx (int count, rtx frameaddr)
 {
-  rtx label;
+  rtx_code_label *label;
   rtx rp;
   rtx saved_rp;
   rtx ins;
diff --git a/gcc/config/picochip/picochip.c b/gcc/config/picochip/picochip.c
index 8738564..29bebb1 100644
--- a/gcc/config/picochip/picochip.c
+++ b/gcc/config/picochip/picochip.c
@@ -488,7 +488,7 @@ int
 picochip_expand_movmemhi (rtx *operands)
 {
   rtx src_addr_reg, dst_addr_reg, count_reg, src_mem, dst_mem, tmp_reg;
-  rtx start_label;
+  rtx_code_label *start_label;
   int align, size;
   src_addr_reg = gen_reg_rtx(HImode);
   dst_addr_reg = gen_reg_rtx(HImode);
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index d8098a7..398f608 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -7105,7 +7105,8 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
 		rs6000_emit_move (got, gsym, Pmode);
 	      else
 		{
-		  rtx mem, lab, last;
+		  rtx mem, last;
+		  rtx_code_label *lab;
 
 		  tmp1 = gen_reg_rtx (Pmode);
 		  tmp2 = gen_reg_rtx (Pmode);
@@ -10723,7 +10724,7 @@ setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
     {
       int fregno = next_cum.fregno, nregs;
       rtx cr1 = gen_rtx_REG (CCmode, CR1_REGNO);
-      rtx lab = gen_label_rtx ();
+      rtx_code_label *lab = gen_label_rtx ();
       int off = (GP_ARG_NUM_REG * reg_size) + ((fregno - FP_ARG_MIN_REG)
 					       * UNITS_PER_FP_WORD);
 
@@ -20101,7 +20102,8 @@ rs6000_expand_atomic_op (enum rtx_code code, rtx mem, rtx val,
   enum memmodel model = (enum memmodel) INTVAL (model_rtx);
   enum machine_mode mode = GET_MODE (mem);
   enum machine_mode store_mode = mode;
-  rtx label, x, cond, mask, shift;
+  rtx label;
+  rtx x, cond, mask, shift;
   rtx before = orig_before, after = orig_after;
 
   mask = shift = NULL_RTX;
@@ -21656,7 +21658,8 @@ rs6000_emit_load_toc_table (int fromprolog)
   if (TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI == ABI_V4 && flag_pic)
     {
       char buf[30];
-      rtx lab, tmp1, tmp2, got;
+      rtx lab;
+      rtx tmp1, tmp2, got;
 
       lab = gen_label_rtx ();
       ASM_GENERATE_INTERNAL_LABEL (buf, "L", CODE_LABEL_NUMBER (lab));
@@ -21704,7 +21707,8 @@ rs6000_emit_load_toc_table (int fromprolog)
 	}
       else
 	{
-	  rtx tocsym, lab;
+	  rtx tocsym;
+	  rtx_code_label *lab;
 
 	  tocsym = gen_rtx_SYMBOL_REF (Pmode, toc_label_name);
 	  lab = gen_label_rtx ();
@@ -23252,7 +23256,8 @@ rs6000_emit_prologue (void)
   /* In AIX ABI we need to make sure r2 is really saved.  */
   if (TARGET_AIX && crtl->calls_eh_return)
     {
-      rtx tmp_reg, tmp_reg_si, hi, lo, compare_result, toc_save_done, jump;
+      rtx tmp_reg, tmp_reg_si, hi, lo, compare_result, jump;
+      rtx_code_label *toc_save_done;
       rtx save_insn, join_insn, note;
       long toc_restore_insn;
 
@@ -28727,7 +28732,7 @@ output_call (rtx insn, rtx *operands, int dest_operand_number,
 
       if (no_previous_def (funname))
 	{
-	  rtx label_rtx = gen_label_rtx ();
+	  rtx_code_label *label_rtx = gen_label_rtx ();
 	  char *label_buf, temp_buf[256];
 	  ASM_GENERATE_INTERNAL_LABEL (temp_buf, "L",
 				       CODE_LABEL_NUMBER (label_rtx));
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 0311365..998e57b 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1704,7 +1704,8 @@
   rtx search_char = operands[2];
   rtx align = operands[3];
   rtx addr, scratch_string, word1, word2, scratch_dlmzb;
-  rtx loop_label, end_label, mem, cr0, cond;
+  rtx_code_label *loop_label, *end_label;
+  rtx mem, cr0, cond;
   if (search_char != const0_rtx
       || GET_CODE (align) != CONST_INT
       || INTVAL (align) < 8)
@@ -6356,7 +6357,7 @@
       rtx val = operands[1];
       if (!flag_unsafe_math_optimizations)
 	{
-	  rtx label = gen_label_rtx ();
+	  rtx_code_label *label = gen_label_rtx ();
 	  val = gen_reg_rtx (DImode);
 	  emit_insn (gen_floatdisf2_internal2 (val, operands[1], label));
 	  emit_label (label);
@@ -9535,7 +9536,7 @@
    && TARGET_LONG_DOUBLE_128"
   "
 {
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
   if (TARGET_E500_DOUBLE)
     {
       if (flag_finite_math_only && !flag_trapping_math)
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 417e2a8..c6814f3 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -4078,9 +4078,9 @@ s390_expand_movmem (rtx dst, rtx src, rtx len)
   else
     {
       rtx dst_addr, src_addr, count, blocks, temp;
-      rtx loop_start_label = gen_label_rtx ();
-      rtx loop_end_label = gen_label_rtx ();
-      rtx end_label = gen_label_rtx ();
+      rtx_code_label *loop_start_label = gen_label_rtx ();
+      rtx_code_label *loop_end_label = gen_label_rtx ();
+      rtx_code_label *end_label = gen_label_rtx ();
       enum machine_mode mode;
 
       mode = GET_MODE (len);
@@ -4203,9 +4203,9 @@ s390_expand_setmem (rtx dst, rtx len, rtx val)
   else
     {
       rtx dst_addr, count, blocks, temp, dstp1 = NULL_RTX;
-      rtx loop_start_label = gen_label_rtx ();
-      rtx loop_end_label = gen_label_rtx ();
-      rtx end_label = gen_label_rtx ();
+      rtx_code_label *loop_start_label = gen_label_rtx ();
+      rtx_code_label *loop_end_label = gen_label_rtx ();
+      rtx_code_label *end_label = gen_label_rtx ();
       enum machine_mode mode;
 
       mode = GET_MODE (len);
@@ -4329,9 +4329,9 @@ s390_expand_cmpmem (rtx target, rtx op0, rtx op1, rtx len)
   else
     {
       rtx addr0, addr1, count, blocks, temp;
-      rtx loop_start_label = gen_label_rtx ();
-      rtx loop_end_label = gen_label_rtx ();
-      rtx end_label = gen_label_rtx ();
+      rtx_code_label *loop_start_label = gen_label_rtx ();
+      rtx_code_label *loop_end_label = gen_label_rtx ();
+      rtx_code_label *end_label = gen_label_rtx ();
       enum machine_mode mode;
 
       mode = GET_MODE (len);
@@ -4886,7 +4886,7 @@ s390_expand_cs_hqi (enum machine_mode mode, rtx btarget, rtx vtarget, rtx mem,
   struct alignment_context ac;
   rtx cmpv, newv, val, cc, seq0, seq1, seq2, seq3;
   rtx res = gen_reg_rtx (SImode);
-  rtx csloop = NULL, csend = NULL;
+  rtx_code_label *csloop = NULL, *csend = NULL;
 
   gcc_assert (MEM_P (mem));
 
@@ -4969,7 +4969,7 @@ s390_expand_atomic (enum machine_mode mode, enum rtx_code code,
   rtx cmp;
   rtx new_rtx = gen_reg_rtx (SImode);
   rtx orig = gen_reg_rtx (SImode);
-  rtx csloop = gen_label_rtx ();
+  rtx_code_label *csloop = gen_label_rtx ();
 
   gcc_assert (!target || register_operand (target, VOIDmode));
   gcc_assert (MEM_P (mem));
@@ -6304,7 +6304,7 @@ struct constant_pool
 
   struct constant *constants[NR_C_MODES];
   struct constant *execute;
-  rtx label;
+  rtx_code_label *label;
   int size;
 };
 
@@ -6800,7 +6800,7 @@ s390_mainpool_finish (struct constant_pool *pool)
      over it, setting up the pool register at the same time.  */
   else
     {
-      rtx pool_end = gen_label_rtx ();
+      rtx_code_label *pool_end = gen_label_rtx ();
 
       insn = gen_main_base_31_large (base_reg, pool->label, pool_end);
       insn = emit_jump_insn_after (insn, pool->pool_insn);
@@ -7002,7 +7002,8 @@ s390_chunkify_start (void)
 	           || curr_pool->size > S390_POOL_CHUNK_MAX
 		   || section_switch_p)
 	    {
-	      rtx label, jump, barrier, next, prev;
+	      rtx_code_label *label;
+	      rtx jump, barrier, next, prev;
 
 	      if (!section_switch_p)
 		{
@@ -9904,7 +9905,7 @@ s390_expand_tbegin (rtx dest, rtx tdb, rtx retry, bool clobber_fprs_p)
 {
   rtx retry_plus_two = gen_reg_rtx (SImode);
   rtx retry_reg = gen_reg_rtx (SImode);
-  rtx retry_label = NULL_RTX;
+  rtx_code_label *retry_label = NULL_RTX_CODE_LABEL;
 
   if (retry != NULL_RTX)
     {
@@ -9932,7 +9933,7 @@ s390_expand_tbegin (rtx dest, rtx tdb, rtx retry, bool clobber_fprs_p)
       const int CC3 = 1 << 0;
       rtx jump;
       rtx count = gen_reg_rtx (SImode);
-      rtx leave_label = gen_label_rtx ();
+      rtx_code_label *leave_label = gen_label_rtx ();
 
       /* Exit for success and permanent failures.  */
       jump = s390_emit_jump (leave_label,
@@ -11078,7 +11079,8 @@ static bool
 s390_fix_long_loop_prediction (rtx insn)
 {
   rtx set = single_set (insn);
-  rtx code_label, label_ref, new_label;
+  rtx code_label, label_ref;
+  rtx_code_label *new_label;
   rtx uncond_jump;
   rtx cur_insn;
   rtx tmp;
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index b17c1fa..6331b78 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -4124,8 +4124,8 @@
 {
   if (!TARGET_Z196)
     {
-      rtx label1 = gen_label_rtx ();
-      rtx label2 = gen_label_rtx ();
+      rtx_code_label *label1 = gen_label_rtx ();
+      rtx_code_label *label2 = gen_label_rtx ();
       rtx temp = gen_reg_rtx (TDmode);
       REAL_VALUE_TYPE cmp, sub;
 
@@ -4163,8 +4163,8 @@
 {
   if (!TARGET_Z196)
     {
-      rtx label1 = gen_label_rtx ();
-      rtx label2 = gen_label_rtx ();
+      rtx_code_label *label1 = gen_label_rtx ();
+      rtx_code_label *label2 = gen_label_rtx ();
       rtx temp = gen_reg_rtx (TDmode);
       REAL_VALUE_TYPE cmp, sub;
 
@@ -4202,8 +4202,8 @@
 {
   if (!TARGET_Z196)
     {
-      rtx label1 = gen_label_rtx ();
-      rtx label2 = gen_label_rtx ();
+      rtx_code_label *label1 = gen_label_rtx ();
+      rtx_code_label *label2 = gen_label_rtx ();
       rtx temp = gen_reg_rtx (<BFP:MODE>mode);
       REAL_VALUE_TYPE cmp, sub;
 
@@ -6115,7 +6115,7 @@
     {
       if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) < 0)
         {
-          rtx label1 = gen_label_rtx ();
+          rtx_code_label *label1 = gen_label_rtx ();
 
 	  operands[1] = make_safe_from (operands[1], operands[0]);
           emit_move_insn (operands[0], const0_rtx);
@@ -6141,9 +6141,9 @@
     }
   else
     {
-      rtx label1 = gen_label_rtx ();
-      rtx label2 = gen_label_rtx ();
-      rtx label3 = gen_label_rtx ();
+      rtx_code_label *label1 = gen_label_rtx ();
+      rtx_code_label *label2 = gen_label_rtx ();
+      rtx_code_label *label3 = gen_label_rtx ();
 
       operands[1] = force_reg (SImode, operands[1]);
       operands[1] = make_safe_from (operands[1], operands[0]);
@@ -6201,7 +6201,7 @@
     {
       if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) <= 0)
         {
-          rtx label1 = gen_label_rtx ();
+          rtx_code_label *label1 = gen_label_rtx ();
 
           operands[1] = make_safe_from (operands[1], operands[0]);
 	  emit_move_insn (operands[0], operands[1]);
@@ -6228,9 +6228,9 @@
     }
   else
     {
-      rtx label1 = gen_label_rtx ();
-      rtx label2 = gen_label_rtx ();
-      rtx label3 = gen_label_rtx ();
+      rtx_code_label *label1 = gen_label_rtx ();
+      rtx_code_label *label2 = gen_label_rtx ();
+      rtx_code_label *label3 = gen_label_rtx ();
 
       operands[1] = force_reg (SImode, operands[1]);
       operands[1] = make_safe_from (operands[1], operands[0]);
diff --git a/gcc/config/sh/sh-mem.cc b/gcc/config/sh/sh-mem.cc
index d3110f2..179c7e7 100644
--- a/gcc/config/sh/sh-mem.cc
+++ b/gcc/config/sh/sh-mem.cc
@@ -201,11 +201,11 @@ sh_expand_cmpstr (rtx *operands)
   rtx tmp3 = gen_reg_rtx (SImode);
 
   rtx jump;
-  rtx L_return = gen_label_rtx ();
-  rtx L_loop_byte = gen_label_rtx ();
-  rtx L_end_loop_byte = gen_label_rtx ();
-  rtx L_loop_long = gen_label_rtx ();
-  rtx L_end_loop_long = gen_label_rtx ();
+  rtx_code_label *L_return = gen_label_rtx ();
+  rtx_code_label *L_loop_byte = gen_label_rtx ();
+  rtx_code_label *L_end_loop_byte = gen_label_rtx ();
+  rtx_code_label *L_loop_long = gen_label_rtx ();
+  rtx_code_label *L_end_loop_long = gen_label_rtx ();
 
   int align = INTVAL (operands[3]);
 
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index f467236..9c66b5c 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2050,7 +2050,7 @@ bool
 expand_cbranchdi4 (rtx *operands, enum rtx_code comparison)
 {
   enum rtx_code msw_taken, msw_skip, lsw_taken;
-  rtx skip_label = NULL_RTX;
+  rtx_code_label *skip_label = NULL_RTX_CODE_LABEL;
   rtx op1h, op1l, op2h, op2l;
   int num_branches;
   int prob, rev_prob;
@@ -2646,7 +2646,7 @@ const char *
 output_far_jump (rtx insn, rtx op)
 {
   struct { rtx lab, reg, op; } this_jmp;
-  rtx braf_base_lab = NULL_RTX;
+  rtx_code_label *braf_base_lab = NULL_RTX_CODE_LABEL;
   const char *jump;
   int far;
   int offset = branch_dest (insn) - INSN_ADDRESSES (INSN_UID (insn));
@@ -2843,6 +2843,7 @@ output_branchy_insn (enum rtx_code code, const char *templ,
 		     rtx insn, rtx *operands)
 {
   rtx next_insn = NEXT_INSN (insn);
+  rtx_code_label *lab;
 
   if (next_insn && JUMP_P (next_insn) && condjump_p (next_insn))
     {
@@ -2850,8 +2851,8 @@ output_branchy_insn (enum rtx_code code, const char *templ,
       if (GET_CODE (src) == IF_THEN_ELSE && GET_CODE (XEXP (src, 0)) != code)
 	{
 	  /* Following branch not taken */
-	  operands[9] = gen_label_rtx ();
-	  emit_label_after (operands[9], next_insn);
+	  operands[9] = lab = gen_label_rtx ();
+	  emit_label_after (lab, next_insn);
 	  INSN_ADDRESSES_NEW (operands[9],
 			      INSN_ADDRESSES (INSN_UID (next_insn))
 			      + get_attr_length (next_insn));
@@ -2871,8 +2872,8 @@ output_branchy_insn (enum rtx_code code, const char *templ,
 	    }
 	}
     }
-  operands[9] = gen_label_rtx ();
-  emit_label_after (operands[9], insn);
+  operands[9] = lab = gen_label_rtx ();
+  emit_label_after (lab, insn);
   INSN_ADDRESSES_NEW (operands[9],
 		      INSN_ADDRESSES (INSN_UID (insn))
 		      + get_attr_length (insn));
@@ -4948,7 +4949,7 @@ fixup_mova (rtx mova)
   else
     {
       rtx worker = mova;
-      rtx lab = gen_label_rtx ();
+      rtx_code_label *lab = gen_label_rtx ();
       rtx wpat, wpat0, wpat1, wsrc, target, base, diff;
 
       do
@@ -5303,7 +5304,7 @@ find_barrier (int num_mova, rtx mova, rtx from)
     {
       /* We didn't find a barrier in time to dump our stuff,
 	 so we'll make one.  */
-      rtx label = gen_label_rtx ();
+      rtx_code_label *label = gen_label_rtx ();
 
       /* Don't emit a constant table in the middle of insns for
 	 casesi_worker_2.  This is a bit overkill but is enough
@@ -5724,7 +5725,7 @@ struct far_branch
 {
   /* A label (to be placed) in front of the jump
      that jumps to our ultimate destination.  */
-  rtx near_label;
+  rtx_code_label *near_label;
   /* Where we are going to insert it if we cannot move the jump any farther,
      or the jump itself if we have picked up an existing jump.  */
   rtx insert_place;
@@ -5743,7 +5744,7 @@ gen_far_branch (struct far_branch *bp)
 {
   rtx insn = bp->insert_place;
   rtx jump;
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
   int ok;
 
   emit_label_after (label, insn);
@@ -6038,7 +6039,8 @@ sh_reorg (void)
 
       for (insn = first; insn; insn = NEXT_INSN (insn))
 	{
-	  rtx pattern, reg, link, set, scan, dies, label;
+	  rtx pattern, reg, link, set, scan, dies;
+	  rtx_code_label *label;
 	  int rescan = 0, foundinsn = 0;
 
 	  if (CALL_P (insn))
@@ -6513,7 +6515,7 @@ split_branches (rtx first)
 		rtx src = SET_SRC (PATTERN (insn));
 		rtx olabel = XEXP (XEXP (src, 1), 0);
 		int addr = INSN_ADDRESSES (INSN_UID (insn));
-		rtx label = 0;
+		rtx_code_label *label = 0;
 		int dest_uid = get_dest_uid (olabel, max_uid);
 		struct far_branch *bp = uid_branch[dest_uid];
 
@@ -6550,8 +6552,9 @@ split_branches (rtx first)
 			else
 			  block = gen_block_redirect (block,
 						      bp->address, 2);
-			label = emit_label_after (gen_label_rtx (),
-						  PREV_INSN (block));
+			label = as_a <rtx_code_label *> (
+				  emit_label_after (gen_label_rtx (),
+						    PREV_INSN (block)));
 			bp->near_label = label;
 		      }
 		    else if (label && ! NEXT_INSN (label))
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index d998af9..fa05a6b 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -5758,7 +5758,7 @@ label:
   "TARGET_SH1 && ! TARGET_ZDCBRANCH"
   [(const_int 0)]
 {
-  rtx skip_neg_label = gen_label_rtx ();
+  rtx_code_label *skip_neg_label = gen_label_rtx ();
 
   emit_move_insn (operands[0], operands[1]);
 
@@ -5785,7 +5785,7 @@ label:
   "&& can_create_pseudo_p ()"
   [(const_int 0)]
 {
-  rtx skip_neg_label = gen_label_rtx ();
+  rtx_code_label *skip_neg_label = gen_label_rtx ();
 
   emit_move_insn (operands[0], operands[1]);
 
@@ -11921,7 +11921,7 @@ label:
   "&& 1"
   [(const_int 0)]
 {
-  rtx skip_label = gen_label_rtx ();
+  rtx_code_label *skip_label = gen_label_rtx ();
   emit_move_insn (operands[0], operands[1]);
 
   rtx cmp_val = operands[2];
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 7bfd3c1..9be9548 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -7263,7 +7263,7 @@ sparc_struct_value_rtx (tree fndecl, int incoming)
 	     provided.  */
 	  rtx ret_reg = gen_rtx_REG (Pmode, 31);
 	  rtx scratch = gen_reg_rtx (SImode);
-	  rtx endlab = gen_label_rtx ();
+	  rtx_code_label *endlab = gen_label_rtx ();
 
 	  /* Calculate the return object size */
 	  tree size = TYPE_SIZE_UNIT (TREE_TYPE (fndecl));
@@ -8051,7 +8051,8 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison)
 void
 sparc_emit_floatunsdi (rtx *operands, enum machine_mode mode)
 {
-  rtx neglab, donelab, i0, i1, f0, in, out;
+  rtx_code_label *neglab, *donelab;
+  rtx i0, i1, f0, in, out;
 
   out = operands[0];
   in = force_reg (DImode, operands[1]);
@@ -8084,7 +8085,8 @@ sparc_emit_floatunsdi (rtx *operands, enum machine_mode mode)
 void
 sparc_emit_fixunsdi (rtx *operands, enum machine_mode mode)
 {
-  rtx neglab, donelab, i0, i1, f0, in, out, limit;
+  rtx_code_label *neglab, *donelab;
+  rtx i0, i1, f0, in, out, limit;
 
   out = operands[0];
   in = force_reg (mode, operands[1]);
@@ -11725,7 +11727,8 @@ sparc_expand_compare_and_swap_12 (rtx bool_result, rtx result, rtx mem,
   rtx newvalue = gen_reg_rtx (SImode);
   rtx res = gen_reg_rtx (SImode);
   rtx resv = gen_reg_rtx (SImode);
-  rtx memsi, val, mask, end_label, loop_label, cc;
+  rtx memsi, val, mask, cc;
+  rtx_code_label *end_label, *loop_label;
 
   emit_insn (gen_rtx_SET (VOIDmode, addr,
 			  gen_rtx_AND (Pmode, addr1, GEN_INT (-4))));
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 31698cc..55aeef1 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -4273,7 +4273,8 @@ ea_load_store_inline (rtx mem, bool is_store, rtx ea_addr, rtx data_addr)
   rtx tag_eq_pack = gen_reg_rtx (V4SImode);
   rtx tag_eq_pack_si = gen_reg_rtx (SImode);
   rtx eq_index = gen_reg_rtx (SImode);
-  rtx bcomp, hit_label, hit_ref, cont_label, insn;
+  rtx bcomp, hit_ref, insn;
+  rtx_code_label *hit_label, *cont_label;
 
   if (spu_ea_model != 32)
     {
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 6a64fcc..d00eaf6 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -174,7 +174,7 @@ xstormy16_emit_cbranch (enum rtx_code code, rtx op0, rtx op1, rtx loc)
     {
       int unsigned_p = (code == GTU || code == LEU);
       int gt_p = (code == GT || code == GTU);
-      rtx lab = NULL_RTX;
+      rtx_code_label *lab = NULL_RTX_CODE_LABEL;
 
       if (gt_p)
 	lab = gen_label_rtx ();
@@ -191,7 +191,7 @@ xstormy16_emit_cbranch (enum rtx_code code, rtx op0, rtx op1, rtx loc)
 	   && op1 != const0_rtx)
     {
       rtx op0_word, op1_word;
-      rtx lab = NULL_RTX;
+      rtx_code_label *lab = NULL_RTX_CODE_LABEL;
       int num_words = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
       int i;
 
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index 70fce93..33dc3a5 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -2656,7 +2656,8 @@ tilegx_output_cbranch_with_opcode (rtx insn, rtx *operands,
 				   const char *rev_opcode, int regop)
 {
   const char *branch_if_false;
-  rtx taken, not_taken;
+  rtx taken;
+  rtx_code_label *not_taken;
   bool is_simple_branch;
 
   gcc_assert (LABEL_P (operands[0]));
diff --git a/gcc/config/tilepro/tilepro.c b/gcc/config/tilepro/tilepro.c
index e89a733..bc97c41 100644
--- a/gcc/config/tilepro/tilepro.c
+++ b/gcc/config/tilepro/tilepro.c
@@ -2461,7 +2461,8 @@ tilepro_output_cbranch_with_opcode (rtx insn, rtx *operands,
 				    int regop, bool netreg_p)
 {
   const char *branch_if_false;
-  rtx taken, not_taken;
+  rtx taken;
+  rtx_code_label *not_taken;
   bool is_simple_branch;
 
   gcc_assert (LABEL_P (operands[0]));
diff --git a/gcc/config/vax/builtins.md b/gcc/config/vax/builtins.md
index ea74863..84128fb 100644
--- a/gcc/config/vax/builtins.md
+++ b/gcc/config/vax/builtins.md
@@ -30,7 +30,7 @@
   ""
   "
 {
-  rtx label = gen_label_rtx ();
+  rtx_code_label label = gen_label_rtx ();
   emit_insn (gen_ffssi2_internal (operands[0], operands[1]));
   emit_jump_insn (gen_bne (label));
   emit_insn (gen_negsi2 (operands[0], const1_rtx));
@@ -54,7 +54,7 @@
   ""
   "
 {
-  rtx label;
+  rtx_code_label label;
 
   if (operands[2] != const1_rtx)
     FAIL;
@@ -126,7 +126,7 @@
   ""
   "
 {
-  rtx label;
+  rtx_code_label label;
   if (operands[1] != const0_rtx)
     FAIL;
 #if 1
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 6b6693f..14538e6 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -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);
@@ -2721,7 +2721,8 @@ xtensa_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
 rtx
 xtensa_return_addr (int count, rtx frame)
 {
-  rtx result, retaddr, curaddr, label;
+  rtx result, retaddr, curaddr;
+  rtx_code_label *label;
 
   if (count == -1)
     retaddr = gen_rtx_REG (Pmode, A0_REG);
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 3a81ffb..96bdb9f 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -771,7 +771,7 @@ do_jump_by_parts_zero_rtx (enum machine_mode mode, rtx op0,
   int nwords = GET_MODE_SIZE (mode) / UNITS_PER_WORD;
   rtx part;
   int i;
-  rtx drop_through_label = 0;
+  rtx_code_label *drop_through_label = 0;
 
   /* The fastest way of doing this comparison on almost any machine is to
      "or" all the words and compare the result.  If all have to be loaded
@@ -819,7 +819,7 @@ do_jump_by_parts_equality_rtx (enum machine_mode mode, rtx op0, rtx op1,
 			       rtx_code_label *if_true_label, int prob)
 {
   int nwords = (GET_MODE_SIZE (mode) / UNITS_PER_WORD);
-  rtx drop_through_label = 0;
+  rtx_code_label *drop_through_label = 0;
   int i;
 
   if (op1 == const0_rtx)
diff --git a/gcc/except.c b/gcc/except.c
index ec712a9..fa57091 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -1290,7 +1290,7 @@ sjlj_emit_function_exit (void)
 }
 
 static void
-sjlj_emit_dispatch_table (rtx dispatch_label, int num_dispatch)
+sjlj_emit_dispatch_table (rtx_code_label *dispatch_label, int num_dispatch)
 {
   enum machine_mode unwind_word_mode = targetm.unwind_word_mode ();
   enum machine_mode filter_mode = targetm.eh_return_filter_mode ();
@@ -1353,7 +1353,8 @@ sjlj_emit_dispatch_table (rtx dispatch_label, int num_dispatch)
   for (i = 1; vec_safe_iterate (cfun->eh->lp_array, i, &lp); ++i)
     if (lp && lp->post_landing_pad)
       {
-	rtx seq2, label;
+	rtx seq2;
+	rtx_code_label *label;
 
 	start_sequence ();
 
@@ -1467,7 +1468,7 @@ sjlj_build_landing_pads (void)
   num_dispatch = sjlj_assign_call_site_values ();
   if (num_dispatch > 0)
     {
-      rtx dispatch_label = gen_label_rtx ();
+      rtx_code_label *dispatch_label = gen_label_rtx ();
       int align = STACK_SLOT_ALIGNMENT (sjlj_fc_type_node,
 					TYPE_MODE (sjlj_fc_type_node),
 					TYPE_ALIGN (sjlj_fc_type_node));
@@ -2262,7 +2263,7 @@ expand_builtin_eh_return (tree stackadj_tree ATTRIBUTE_UNUSED,
 void
 expand_eh_return (void)
 {
-  rtx around_label;
+  rtx_code_label *around_label;
 
   if (! crtl->eh.ehr_label)
     return;
diff --git a/gcc/except.h b/gcc/except.h
index bab13e1..f2d44cf 100644
--- a/gcc/except.h
+++ b/gcc/except.h
@@ -87,7 +87,7 @@ struct GTY(()) eh_landing_pad_d
      EXCEPTION_RECEIVER pattern will be expanded here, as well as other
      bookkeeping specific to exceptions.  There must not be normal edges
      into the block containing the landing-pad label.  */
-  rtx landing_pad;
+  rtx_code_label *landing_pad;
 
   /* The index of this landing pad within fun->eh->lp_array.  */
   int index;
diff --git a/gcc/explow.c b/gcc/explow.c
index e39db05..99a5cc2 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -1160,7 +1160,8 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
 			      unsigned required_align, bool cannot_accumulate)
 {
   HOST_WIDE_INT stack_usage_size = -1;
-  rtx final_label, final_target, target;
+  rtx_code_label *final_label;
+  rtx final_target, target;
   unsigned extra_align = 0;
   bool must_align;
 
@@ -1313,7 +1314,7 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
 	current_function_has_unbounded_dynamic_stack_size = 1;
     }
 
-  final_label = NULL_RTX;
+  final_label = NULL_RTX_CODE_LABEL;
   final_target = NULL_RTX;
 
   /* If we are splitting the stack, we need to ask the backend whether
@@ -1325,9 +1326,10 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
      least it doesn't cause a stack overflow.  */
   if (flag_split_stack)
     {
-      rtx available_label, ask, space, func;
+      rtx_code_label *available_label;
+      rtx ask, space, func;
 
-      available_label = NULL_RTX;
+      available_label = NULL_RTX_CODE_LABEL;
 
 #ifdef HAVE_split_stack_space_check
       if (HAVE_split_stack_space_check)
@@ -1420,7 +1422,7 @@ allocate_dynamic_stack_space (rtx size, unsigned size_align,
       if (crtl->limit_stack)
 	{
 	  rtx available;
-	  rtx space_available = gen_label_rtx ();
+	  rtx_code_label *space_available = gen_label_rtx ();
 #ifdef STACK_GROWS_DOWNWARD
 	  available = expand_binop (Pmode, sub_optab,
 				    stack_pointer_rtx, stack_limit_rtx,
@@ -1622,8 +1624,8 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
   else
     {
       rtx rounded_size, rounded_size_op, test_addr, last_addr, temp;
-      rtx loop_lab = gen_label_rtx ();
-      rtx end_lab = gen_label_rtx ();
+      rtx_code_label *loop_lab = gen_label_rtx ();
+      rtx_code_label *end_lab = gen_label_rtx ();
 
 
       /* Step 1: round SIZE to the previous multiple of the interval.  */
@@ -1770,8 +1772,8 @@ anti_adjust_stack_and_probe (rtx size, bool adjust_back)
   else
     {
       rtx rounded_size, rounded_size_op, last_addr, temp;
-      rtx loop_lab = gen_label_rtx ();
-      rtx end_lab = gen_label_rtx ();
+      rtx_code_label *loop_lab = gen_label_rtx ();
+      rtx_code_label *end_lab = gen_label_rtx ();
 
 
       /* Step 1: round SIZE to the previous multiple of the interval.  */
diff --git a/gcc/expr.c b/gcc/expr.c
index 9b6f228..7ff3901 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -152,7 +152,8 @@ static rtx do_store_flag (sepops, rtx, enum machine_mode);
 #ifdef PUSH_ROUNDING
 static void emit_single_push_insn (enum machine_mode, rtx, tree);
 #endif
-static void do_tablejump (rtx, enum machine_mode, rtx, rtx, rtx, int);
+static void do_tablejump (rtx, enum machine_mode, rtx, rtx_code_label *,
+			  rtx_code_label *, int);
 static rtx const_vector_from_tree (tree);
 static void write_complex_part (rtx, rtx, bool);
 
@@ -1451,7 +1452,8 @@ static void
 emit_block_move_via_loop (rtx x, rtx y, rtx size,
 			  unsigned int align ATTRIBUTE_UNUSED)
 {
-  rtx cmp_label, top_label, iter, x_addr, y_addr, tmp;
+  rtx_code_label *cmp_label, *top_label;
+  rtx iter, x_addr, y_addr, tmp;
   enum machine_mode x_addr_mode = get_address_mode (x);
   enum machine_mode y_addr_mode = get_address_mode (y);
   enum machine_mode iter_mode;
@@ -5387,7 +5389,7 @@ store_expr (tree exp, rtx target, int call_param_p, bool nontemporal)
 		= expand_expr (copy_size, NULL_RTX, VOIDmode,
 			       (call_param_p
 				? EXPAND_STACK_PARM : EXPAND_NORMAL));
-	      rtx label = 0;
+	      rtx_code_label *label = 0;
 
 	      /* Copy that much.  */
 	      copy_size_rtx = convert_to_mode (pointer_mode, copy_size_rtx,
@@ -11013,8 +11015,8 @@ do_store_flag (sepops ops, rtx target, enum machine_mode mode)
    label.  */
 int
 try_casesi (tree index_type, tree index_expr, tree minval, tree range,
-	    rtx table_label, rtx default_label, rtx fallback_label,
-            int default_probability)
+	    rtx_code_label *table_label, rtx_code_label *default_label,
+	    rtx_code_label *fallback_label, int default_probability)
 {
   struct expand_operand ops[5];
   enum machine_mode index_mode = SImode;
@@ -11088,8 +11090,9 @@ try_casesi (tree index_type, tree index_expr, tree minval, tree range,
    the default label.  */
 
 static void
-do_tablejump (rtx index, enum machine_mode mode, rtx range, rtx table_label,
-	      rtx default_label, int default_probability)
+do_tablejump (rtx index, enum machine_mode mode, rtx range,
+	      rtx_code_label *table_label,
+	      rtx_code_label *default_label, int default_probability)
 {
   rtx temp, vector;
 
@@ -11152,7 +11155,8 @@ do_tablejump (rtx index, enum machine_mode mode, rtx range, rtx table_label,
 
 int
 try_tablejump (tree index_type, tree index_expr, tree minval, tree range,
-	       rtx table_label, rtx default_label, int default_probability)
+	       rtx_code_label *table_label, rtx_code_label *default_label,
+	       int default_probability)
 {
   rtx index;
 
diff --git a/gcc/expr.h b/gcc/expr.h
index 93d5868..ad3e79f 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -530,8 +530,10 @@ extern void do_compare_rtx_and_jump (rtx, rtx, enum rtx_code, int,
 				     rtx_code_label *, int);
 
 /* Two different ways of generating switch statements.  */
-extern int try_casesi (tree, tree, tree, tree, rtx, rtx, rtx, int);
-extern int try_tablejump (tree, tree, tree, tree, rtx, rtx, int);
+extern int try_casesi (tree, tree, tree, tree, rtx_code_label *,
+		       rtx_code_label *, rtx_code_label *, int);
+extern int try_tablejump (tree, tree, tree, tree, rtx_code_label *,
+			  rtx_code_label *, int);
 
 /* Functions from alias.c */
 #include "alias.h"
diff --git a/gcc/function.c b/gcc/function.c
index ec2ea26..bd07643 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4641,7 +4641,7 @@ void
 stack_protect_epilogue (void)
 {
   tree guard_decl = targetm.stack_protect_guard ();
-  rtx label = gen_label_rtx ();
+  rtx_code_label *label = gen_label_rtx ();
   rtx x, y, tmp;
 
   x = expand_normal (crtl->stack_protect_guard);
diff --git a/gcc/function.h b/gcc/function.h
index 810c614..1dbc547 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -144,7 +144,7 @@ typedef struct call_site_record_d *call_site_record;
 struct GTY(()) rtl_eh {
   rtx ehr_stackadj;
   rtx ehr_handler;
-  rtx ehr_label;
+  rtx_code_label *ehr_label;
 
   rtx sjlj_fc;
   rtx sjlj_exit_after;
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index 68b2b66..bac0c8b 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -167,7 +167,8 @@ ubsan_expand_si_overflow_addsub_check (tree_code code, gimple stmt)
 {
   rtx res, op0, op1;
   tree lhs, fn, arg0, arg1;
-  rtx done_label, do_error, target = NULL_RTX;
+  rtx_code_label *done_label, *do_error;
+  rtx target = NULL_RTX;
 
   lhs = gimple_call_lhs (stmt);
   arg0 = gimple_call_arg (stmt, 0);
@@ -213,7 +214,7 @@ ubsan_expand_si_overflow_addsub_check (tree_code code, gimple stmt)
 
   if (icode == CODE_FOR_nothing)
     {
-      rtx sub_check = gen_label_rtx ();
+      rtx_code_label *sub_check = gen_label_rtx ();
       int pos_neg = 3;
 
       /* Compute the operation.  On RTL level, the addition is always
@@ -315,7 +316,8 @@ ubsan_expand_si_overflow_neg_check (gimple stmt)
 {
   rtx res, op1;
   tree lhs, fn, arg1;
-  rtx done_label, do_error, target = NULL_RTX;
+  rtx_code_label *done_label, *do_error;
+  rtx target = NULL_RTX;
 
   lhs = gimple_call_lhs (stmt);
   arg1 = gimple_call_arg (stmt, 1);
@@ -391,7 +393,8 @@ ubsan_expand_si_overflow_mul_check (gimple stmt)
 {
   rtx res, op0, op1;
   tree lhs, fn, arg0, arg1;
-  rtx done_label, do_error, target = NULL_RTX;
+  rtx_code_label *done_label, *do_error;
+  rtx target = NULL_RTX;
 
   lhs = gimple_call_lhs (stmt);
   arg0 = gimple_call_arg (stmt, 0);
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 6894856..32bd376 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -2569,8 +2569,8 @@ expand_doubleword_clz (enum machine_mode mode, rtx op0, rtx target)
   rtx xop0 = force_reg (mode, op0);
   rtx subhi = gen_highpart (word_mode, xop0);
   rtx sublo = gen_lowpart (word_mode, xop0);
-  rtx hi0_label = gen_label_rtx ();
-  rtx after_label = gen_label_rtx ();
+  rtx_code_label *hi0_label = gen_label_rtx ();
+  rtx_code_label *after_label = gen_label_rtx ();
   rtx seq, temp, result;
 
   /* If we were not given a target, use a word_mode register, not a
@@ -2837,7 +2837,7 @@ expand_ffs (enum machine_mode mode, rtx op0, rtx target)
 	 the operation sets condition codes that can be recycled for this.
 	 (This is true on i386, for instance.)  */
 
-      rtx nonzero_label = gen_label_rtx ();
+      rtx_code_label *nonzero_label = gen_label_rtx ();
       emit_cmp_and_jump_insns (op0, CONST0_RTX (mode), NE, 0,
 			       mode, true, nonzero_label);
 
@@ -3558,7 +3558,8 @@ expand_copysign_absneg (enum machine_mode mode, rtx op0, rtx op1, rtx target,
 {
   enum machine_mode imode;
   enum insn_code icode;
-  rtx sign, label;
+  rtx sign;
+  rtx_code_label *label;
 
   if (target == op1)
     target = NULL_RTX;
@@ -4317,7 +4318,7 @@ emit_cmp_and_jump_insn_1 (rtx test, enum machine_mode mode, rtx label, int prob)
 void
 emit_cmp_and_jump_insns (rtx x, rtx y, enum rtx_code comparison, rtx size,
 			 enum machine_mode mode, int unsignedp, rtx label,
-                         int prob)
+			 int prob)
 {
   rtx op0 = x, op1 = y;
   rtx test;
@@ -5056,7 +5057,7 @@ expand_float (rtx to, rtx from, int unsignedp)
      then unconditionally adjust the result.  */
   if (unsignedp && can_do_signed)
     {
-      rtx label = gen_label_rtx ();
+      rtx_code_label *label = gen_label_rtx ();
       rtx temp;
       REAL_VALUE_TYPE offset;
 
@@ -5080,7 +5081,7 @@ expand_float (rtx to, rtx from, int unsignedp)
 	      < GET_MODE_PRECISION (GET_MODE (from)))
 	    {
 	      rtx temp1;
-	      rtx neglabel = gen_label_rtx ();
+	      rtx_code_label *neglabel = gen_label_rtx ();
 
 	      /* Don't use TARGET if it isn't a register, is a hard register,
 		 or is the wrong mode.  */
@@ -5283,7 +5284,8 @@ expand_fix (rtx to, rtx from, int unsignedp)
 	{
 	  int bitsize;
 	  REAL_VALUE_TYPE offset;
-	  rtx limit, lab1, lab2, insn;
+	  rtx limit, insn;
+	  rtx_code_label *lab1, *lab2;
 
 	  bitsize = GET_MODE_PRECISION (GET_MODE (to));
 	  real_2expN (&offset, bitsize - 1, fmode);
@@ -7064,7 +7066,8 @@ static bool
 expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq)
 {
   enum machine_mode mode = GET_MODE (mem);
-  rtx label, cmp_reg, success, oldval;
+  rtx_code_label *label;
+  rtx cmp_reg, success, oldval;
 
   /* The loop we want to generate looks like
 
diff --git a/gcc/reorg.c b/gcc/reorg.c
index e4b6d45..0777d79 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -419,7 +419,7 @@ find_end_label (rtx kind)
       && PATTERN (PREV_INSN (insn)) == kind)
     {
       rtx temp = PREV_INSN (PREV_INSN (insn));
-      rtx label = gen_label_rtx ();
+      rtx_code_label *label = gen_label_rtx ();
       LABEL_NUSES (label) = 0;
 
       /* Put the label before any USE insns that may precede the RETURN
@@ -435,7 +435,7 @@ find_end_label (rtx kind)
     *plabel = insn;
   else
     {
-      rtx label = gen_label_rtx ();
+      rtx_code_label *label = gen_label_rtx ();
       LABEL_NUSES (label) = 0;
       /* If the basic block reorder pass moves the return insn to
 	 some other place try to locate it again and put our
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 935ea2b..ae0c587 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -114,7 +114,7 @@ static void balance_case_nodes (case_node_ptr *, case_node_ptr);
 static int node_has_low_bound (case_node_ptr, tree);
 static int node_has_high_bound (case_node_ptr, tree);
 static int node_is_bounded (case_node_ptr, tree);
-static void emit_case_nodes (rtx, case_node_ptr, rtx, int, tree);
+static void emit_case_nodes (rtx, case_node_ptr, rtx_code_label *, int, tree);
 
 /* Return the rtx-label that corresponds to a LABEL_DECL,
    creating it if necessary.  */
@@ -716,7 +716,7 @@ resolve_operand_name_1 (char *p, tree outputs, tree inputs, tree labels)
 void
 expand_naked_return (void)
 {
-  rtx end_label;
+  rtx_code_label *end_label;
 
   clear_pending_stack_adjust ();
   do_pending_stack_adjust ();
@@ -898,7 +898,8 @@ expand_switch_as_decision_tree_p (tree range,
 
 static void
 emit_case_decision_tree (tree index_expr, tree index_type,
-			 struct case_node *case_list, rtx default_label,
+			 struct case_node *case_list,
+			 rtx_code_label *default_label,
                          int default_prob)
 {
   rtx index = expand_normal (index_expr);
@@ -989,15 +990,16 @@ conditional_probability (int target_prob, int base_prob)
 
 static void
 emit_case_dispatch_table (tree index_expr, tree index_type,
-			  struct case_node *case_list, rtx default_label,
+			  struct case_node *case_list,
+			  rtx_code_label *default_label,
 			  tree minval, tree maxval, tree range,
                           basic_block stmt_bb)
 {
   int i, ncases;
   struct case_node *n;
   rtx *labelvec;
-  rtx fallback_label = label_rtx (case_list->code_label);
-  rtx table_label = gen_label_rtx ();
+  rtx_code_label *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;
   int default_prob = default_edge ? default_edge->probability : 0;
@@ -1157,7 +1159,7 @@ void
 expand_case (gimple stmt)
 {
   tree minval = NULL_TREE, maxval = NULL_TREE, range = NULL_TREE;
-  rtx default_label = NULL_RTX;
+  rtx_code_label *default_label = NULL_RTX_CODE_LABEL;
   unsigned int count, uniq;
   int i;
   int ncases = gimple_switch_num_labels (stmt);
@@ -1358,7 +1360,7 @@ expand_sjlj_dispatch_table (rtx dispatch_index,
       tree minval = build_int_cst (index_type, 0);
       tree maxval = CASE_LOW (dispatch_table.last ());
       tree range = maxval;
-      rtx default_label = gen_label_rtx ();
+      rtx_code_label *default_label = gen_label_rtx ();
 
       for (int i = ncases - 1; i >= 0; --i)
 	{
@@ -1609,7 +1611,7 @@ node_is_bounded (case_node_ptr node, tree index_type)
    tests for the value 50, then this node need not test anything.  */
 
 static void
-emit_case_nodes (rtx index, case_node_ptr node, rtx default_label,
+emit_case_nodes (rtx index, case_node_ptr node, rtx_code_label *default_label,
 		 int default_prob, tree index_type)
 {
   /* If INDEX has an unsigned type, we must make unsigned branches.  */
-- 
1.8.5.3

