OSDN Git Service

* g++.dg/lookup/new1.C: Fix dg-excess-error syntax.
[pf3gnuchains/gcc-fork.git] / gcc / unroll.c
index 518e4a1..6902002 100644 (file)
@@ -1,6 +1,6 @@
 /* Try to unroll loops, and split induction variables.
    Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001,
-   2002, 2003
+   2002, 2003, 2004
    Free Software Foundation, Inc.
    Contributed by James E. Wilson, Cygnus Support/UC Berkeley.
 
@@ -310,13 +310,13 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
       /* If the last instruction is not a BARRIER or a JUMP_INSN, then
         don't do anything.  */
 
-      if (GET_CODE (last_loop_insn) == BARRIER)
+      if (BARRIER_P (last_loop_insn))
        {
          /* Delete the jump insn.  This will delete the barrier also.  */
          last_loop_insn = PREV_INSN (last_loop_insn);
        }
 
-      if (ujump && GET_CODE (last_loop_insn) == JUMP_INSN)
+      if (ujump && JUMP_P (last_loop_insn))
        {
 #ifdef HAVE_cc0
          rtx prev = PREV_INSN (last_loop_insn);
@@ -441,9 +441,9 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
         Just return without unrolling the loop in such cases.  */
 
       insn = loop_start;
-      while (GET_CODE (insn) != CODE_LABEL && GET_CODE (insn) != JUMP_INSN)
+      while (!LABEL_P (insn) && !JUMP_P (insn))
        insn = NEXT_INSN (insn);
-      if (GET_CODE (insn) == JUMP_INSN)
+      if (JUMP_P (insn))
        return;
     }
 
@@ -464,9 +464,9 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
       insert_before = NEXT_INSN (last_loop_insn);
 
       /* Set copy_end to the insn before the jump at the end of the loop.  */
-      if (GET_CODE (last_loop_insn) == BARRIER)
+      if (BARRIER_P (last_loop_insn))
        copy_end = PREV_INSN (PREV_INSN (last_loop_insn));
-      else if (GET_CODE (last_loop_insn) == JUMP_INSN)
+      else if (JUMP_P (last_loop_insn))
        {
          copy_end = PREV_INSN (last_loop_insn);
 #ifdef HAVE_cc0
@@ -500,12 +500,12 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
 
       /* Set insert_before to the jump insn at the end of the loop.
         Set copy_end to before the jump insn at the end of the loop.  */
-      if (GET_CODE (last_loop_insn) == BARRIER)
+      if (BARRIER_P (last_loop_insn))
        {
          insert_before = PREV_INSN (last_loop_insn);
          copy_end = PREV_INSN (insert_before);
        }
-      else if (GET_CODE (last_loop_insn) == JUMP_INSN)
+      else if (JUMP_P (last_loop_insn))
        {
          insert_before = last_loop_insn;
 #ifdef HAVE_cc0
@@ -533,7 +533,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
       /* Normal case: Must copy the compare and branch instructions at the
         end of the loop.  */
 
-      if (GET_CODE (last_loop_insn) == BARRIER)
+      if (BARRIER_P (last_loop_insn))
        {
          /* Loop ends with an unconditional jump and a barrier.
             Handle this like above, don't copy jump and barrier.
@@ -546,7 +546,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
          insert_before = PREV_INSN (last_loop_insn);
          copy_end = PREV_INSN (insert_before);
        }
-      else if (GET_CODE (last_loop_insn) == JUMP_INSN)
+      else if (JUMP_P (last_loop_insn))
        {
          /* Set insert_before to immediately after the JUMP_INSN, so that
             NOTEs at the end of the loop will be correctly handled by
@@ -576,10 +576,10 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
       exit_label = gen_label_rtx ();
 
       insn = loop_start;
-      while (GET_CODE (insn) != CODE_LABEL && GET_CODE (insn) != JUMP_INSN)
+      while (!LABEL_P (insn) && !JUMP_P (insn))
        insn = NEXT_INSN (insn);
 
-      if (GET_CODE (insn) == JUMP_INSN)
+      if (JUMP_P (insn))
        {
          /* The loop starts with a jump down to the exit condition test.
             Start copying the loop after the barrier following this
@@ -603,9 +603,9 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
   /* This should always be the first label in the loop.  */
   start_label = NEXT_INSN (copy_start);
   /* There may be a line number note and/or a loop continue note here.  */
-  while (GET_CODE (start_label) == NOTE)
+  while (NOTE_P (start_label))
     start_label = NEXT_INSN (start_label);
-  if (GET_CODE (start_label) != CODE_LABEL)
+  if (!LABEL_P (start_label))
     {
       /* This can happen as a result of jump threading.  If the first insns in
         the loop test the same condition as the loop's backward jump, or the
@@ -633,8 +633,8 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
     }
 
   if (unroll_type == UNROLL_NAIVE
-      && GET_CODE (last_loop_insn) == BARRIER
-      && GET_CODE (PREV_INSN (last_loop_insn)) == JUMP_INSN
+      && BARRIER_P (last_loop_insn)
+      && JUMP_P (PREV_INSN (last_loop_insn))
       && start_label != JUMP_LABEL (PREV_INSN (last_loop_insn)))
     {
       /* In this case, we must copy the jump and barrier, because they will
@@ -645,7 +645,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
     }
 
   if (unroll_type == UNROLL_NAIVE
-      && GET_CODE (last_loop_insn) == JUMP_INSN
+      && JUMP_P (last_loop_insn)
       && start_label != JUMP_LABEL (last_loop_insn))
     {
       /* ??? The loop ends with a conditional branch that does not branch back
@@ -692,9 +692,9 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
     {
       rtx note;
 
-      if (GET_CODE (insn) == CODE_LABEL)
+      if (LABEL_P (insn))
        local_label[CODE_LABEL_NUMBER (insn)] = 1;
-      else if (GET_CODE (insn) == JUMP_INSN)
+      else if (JUMP_P (insn))
        {
          if (JUMP_LABEL (insn))
            set_label_in_map (map,
@@ -724,10 +724,6 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
 
   map->insn_map = xmalloc (max_insnno * sizeof (rtx));
 
-  /* Set this to zero, to indicate that we are doing loop unrolling,
-     not function inlining.  */
-  map->inline_target = 0;
-
   /* The register and constant maps depend on the number of registers
      present, so the final maps can't be created until after
      find_splittable_regs is called.  However, they are needed for
@@ -762,13 +758,13 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
 
       /* If a register is used in the jump insn, we must not duplicate it
         since it will also be used outside the loop.  */
-      if (GET_CODE (copy_end) == JUMP_INSN)
+      if (JUMP_P (copy_end))
        copy_end_luid--;
 
       /* If we have a target that uses cc0, then we also must not duplicate
         the insn that sets cc0 before the jump insn, if one is present.  */
 #ifdef HAVE_cc0
-      if (GET_CODE (copy_end) == JUMP_INSN
+      if (JUMP_P (copy_end)
          && sets_cc0_p (PREV_INSN (copy_end)))
        copy_end_luid--;
 #endif
@@ -1033,9 +1029,9 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
             and then reset it inside the loop when get to the last
             copy.  */
 
-         if (GET_CODE (last_loop_insn) == BARRIER)
+         if (BARRIER_P (last_loop_insn))
            copy_end = PREV_INSN (PREV_INSN (last_loop_insn));
-         else if (GET_CODE (last_loop_insn) == JUMP_INSN)
+         else if (JUMP_P (last_loop_insn))
            {
              copy_end = PREV_INSN (last_loop_insn);
 #ifdef HAVE_cc0
@@ -1077,7 +1073,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
 
              if (i == unroll_number - 1)
                {
-                 if (GET_CODE (last_loop_insn) == BARRIER)
+                 if (BARRIER_P (last_loop_insn))
                    copy_end = PREV_INSN (PREV_INSN (last_loop_insn));
                  else
                    copy_end = last_loop_insn;
@@ -1091,7 +1087,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
            }
          emit_label_after (labels[0], PREV_INSN (loop_start));
 
-         if (GET_CODE (last_loop_insn) == BARRIER)
+         if (BARRIER_P (last_loop_insn))
            {
              insert_before = PREV_INSN (last_loop_insn);
              copy_end = PREV_INSN (insert_before);
@@ -1195,7 +1191,7 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
   if (unroll_type == UNROLL_MODULO)
     {
       insn = NEXT_INSN (copy_end);
-      if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
+      if (NONJUMP_INSN_P (insn) || JUMP_P (insn))
        PATTERN (insn) = remap_split_bivs (loop, PATTERN (insn));
     }
 
@@ -1274,8 +1270,8 @@ unroll_loop (struct loop *loop, int insn_count, int strength_reduce_p)
         associated LABEL_DECL to point to one of the new label instances.  */
       /* ??? Likewise, we can't delete a NOTE_INSN_DELETED_LABEL note.  */
       if (insn != start_label
-         && ! (GET_CODE (insn) == CODE_LABEL && LABEL_NAME (insn))
-         && ! (GET_CODE (insn) == NOTE
+         && ! (LABEL_P (insn) && LABEL_NAME (insn))
+         && ! (NOTE_P (insn)
                && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))
        insn = delete_related_insns (insn);
       else
@@ -1338,7 +1334,7 @@ simplify_cmp_and_jump_insns (enum rtx_code code, enum machine_mode mode,
 {
   rtx t, insn;
 
-  t = simplify_relational_operation (code, mode, op0, op1);
+  t = simplify_const_relational_operation (code, mode, op0, op1);
   if (!t)
     {
       enum rtx_code scode = signed_condition (code);
@@ -1464,7 +1460,7 @@ precondition_loop_p (const struct loop *loop, rtx *initial_value,
      against max_reg_before_loop to make sure that the register is in
      the range covered by loop_invariant_p.  If it isn't, then it is
      most likely a biv/giv which by definition are not invariant.  */
-  if ((GET_CODE (loop_info->final_value) == REG
+  if ((REG_P (loop_info->final_value)
        && REGNO (loop_info->final_value) >= max_reg_before_loop)
       || (GET_CODE (loop_info->final_value) == PLUS
          && REGNO (XEXP (loop_info->final_value, 0)) >= max_reg_before_loop)
@@ -1603,7 +1599,7 @@ calculate_giv_inc (rtx pattern, rtx src_insn, unsigned int regno)
 
       /* Some ports store large constants in memory and add a REG_EQUAL
         note to the store insn.  */
-      else if (GET_CODE (increment) == MEM)
+      else if (MEM_P (increment))
        {
          rtx note = find_reg_note (src_insn, REG_EQUAL, 0);
          if (note)
@@ -1655,7 +1651,7 @@ calculate_giv_inc (rtx pattern, rtx src_insn, unsigned int regno)
 
   /* Check that the source register is the same as the register we expected
      to see as the source.  If not, something is seriously wrong.  */
-  if (GET_CODE (XEXP (SET_SRC (pattern), 0)) != REG
+  if (!REG_P (XEXP (SET_SRC (pattern), 0))
       || REGNO (XEXP (SET_SRC (pattern), 0)) != regno)
     {
       /* Some machines (e.g. the romp), may emit two add instructions for
@@ -1796,7 +1792,7 @@ copy_loop_body (struct loop *loop, rtx copy_start, rtx copy_end,
             SET_DEST to a new register.  */
 
          if ((set = single_set (insn))
-             && GET_CODE (SET_DEST (set)) == REG
+             && REG_P (SET_DEST (set))
              && addr_combined_regs[REGNO (SET_DEST (set))])
            {
              struct iv_class *bl;
@@ -1844,7 +1840,7 @@ copy_loop_body (struct loop *loop, rtx copy_start, rtx copy_end,
 
                        /* tv->dest_reg will be either a bare register,
                           or else a register plus a constant.  */
-                       if (GET_CODE (tv->dest_reg) == REG)
+                       if (REG_P (tv->dest_reg))
                          dest_reg = tv->dest_reg;
                        else
                          dest_reg = XEXP (tv->dest_reg, 0);
@@ -1890,7 +1886,7 @@ copy_loop_body (struct loop *loop, rtx copy_start, rtx copy_end,
          dest_reg_was_split = 0;
 
          if ((set = single_set (insn))
-             && GET_CODE (SET_DEST (set)) == REG
+             && REG_P (SET_DEST (set))
              && splittable_regs[REGNO (SET_DEST (set))])
            {
              unsigned int regno = REGNO (SET_DEST (set));
@@ -2129,7 +2125,7 @@ copy_loop_body (struct loop *loop, rtx copy_start, rtx copy_end,
                    }
                }
 
-             if (label && GET_CODE (label) == CODE_LABEL)
+             if (label && LABEL_P (label))
                JUMP_LABEL (copy) = label;
              else
                {
@@ -2256,8 +2252,7 @@ copy_loop_body (struct loop *loop, rtx copy_start, rtx copy_end,
   do
     {
       insn = NEXT_INSN (insn);
-      if ((GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN
-          || GET_CODE (insn) == CALL_INSN)
+      if (INSN_P (insn)
          && map->insn_map[INSN_UID (insn)])
        final_reg_note_copy (&REG_NOTES (map->insn_map[INSN_UID (insn)]), map);
     }
@@ -2283,7 +2278,7 @@ copy_loop_body (struct loop *loop, rtx copy_start, rtx copy_end,
             instructions before the last insn in the loop, COPY_NOTES_FROM
             can be a NOTE_INSN_LOOP_CONT note if there is no VTOP note,
             as in a do .. while loop.  */
-         if (GET_CODE (insn) == NOTE
+         if (NOTE_P (insn)
              && ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
                   && NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
                   && NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
@@ -2334,7 +2329,7 @@ back_branch_in_range_p (const struct loop *loop, rtx insn)
 
   /* Stop before we get to the backward branch at the end of the loop.  */
   loop_end = prev_nonnote_insn (loop_end);
-  if (GET_CODE (loop_end) == BARRIER)
+  if (BARRIER_P (loop_end))
     loop_end = PREV_INSN (loop_end);
 
   /* Check in case insn has been deleted, search forward for first non
@@ -2350,7 +2345,7 @@ back_branch_in_range_p (const struct loop *loop, rtx insn)
 
   for (p = NEXT_INSN (insn); p != loop_end; p = NEXT_INSN (p))
     {
-      if (GET_CODE (p) == JUMP_INSN)
+      if (JUMP_P (p))
        {
          target_insn = JUMP_LABEL (p);
 
@@ -2521,7 +2516,7 @@ find_splittable_regs (const struct loop *loop,
         PLUS, we don't know how to split it.  */
       for (v = bl->biv; biv_splittable && v; v = v->next_iv)
        if ((tem = single_set (v->insn)) == 0
-           || GET_CODE (SET_DEST (tem)) != REG
+           || !REG_P (SET_DEST (tem))
            || REGNO (SET_DEST (tem)) != bl->regno
            || GET_CODE (SET_SRC (tem)) != PLUS)
          biv_splittable = 0;
@@ -2543,7 +2538,7 @@ find_splittable_regs (const struct loop *loop,
                 register, or it isn't invariant, then we must create a new
                 pseudo reg to hold the initial value of the biv.  */
 
-             if (GET_CODE (bl->initial_value) == REG
+             if (REG_P (bl->initial_value)
                  && (REGNO (bl->initial_value) == bl->regno
                      || REGNO (bl->initial_value) < FIRST_PSEUDO_REGISTER
                      || ! loop_invariant_p (loop, bl->initial_value)))
@@ -2746,7 +2741,7 @@ find_splittable_givs (const struct loop *loop, struct iv_class *bl,
 
          if (splittable_regs[bl->regno])
            biv_initial_value = splittable_regs[bl->regno];
-         else if (GET_CODE (bl->initial_value) != REG
+         else if (!REG_P (bl->initial_value)
                   || (REGNO (bl->initial_value) != bl->regno
                       && REGNO (bl->initial_value) >= FIRST_PSEUDO_REGISTER))
            biv_initial_value = bl->initial_value;
@@ -2790,9 +2785,9 @@ find_splittable_givs (const struct loop *loop, struct iv_class *bl,
                 is going before the loop start.  */
              if (unroll_type == UNROLL_COMPLETELY
                  && GET_CODE (value) != CONST_INT
-                 && GET_CODE (value) != REG
+                 && !REG_P (value)
                  && (GET_CODE (value) != PLUS
-                     || GET_CODE (XEXP (value, 0)) != REG
+                     || !REG_P (XEXP (value, 0))
                      || GET_CODE (XEXP (value, 1)) != CONST_INT))
                {
                  rtx tem = gen_reg_rtx (v->mode);
@@ -2831,7 +2826,7 @@ find_splittable_givs (const struct loop *loop, struct iv_class *bl,
         a splittable register.  Don't need to do anything for address givs
         where this may not be a register.  */
 
-      if (GET_CODE (v->new_reg) == REG)
+      if (REG_P (v->new_reg))
        {
          int count = 1;
          if (! v->ignore)
@@ -2848,7 +2843,7 @@ find_splittable_givs (const struct loop *loop, struct iv_class *bl,
 
          if (GET_CODE (v->dest_reg) == CONST_INT)
            regnum = -1;
-         else if (GET_CODE (v->dest_reg) != REG)
+         else if (!REG_P (v->dest_reg))
            regnum = REGNO (XEXP (v->dest_reg, 0));
          else
            regnum = REGNO (v->dest_reg);
@@ -2872,7 +2867,6 @@ static int
 reg_dead_after_loop (const struct loop *loop, rtx reg)
 {
   rtx insn, label;
-  enum rtx_code code;
   int jump_count = 0;
   int label_count = 0;
 
@@ -2902,8 +2896,7 @@ reg_dead_after_loop (const struct loop *loop, rtx reg)
       insn = NEXT_INSN (XEXP (label, 0));
       while (insn)
        {
-         code = GET_CODE (insn);
-         if (GET_RTX_CLASS (code) == 'i')
+         if (INSN_P (insn))
            {
              rtx set, note;
 
@@ -2917,18 +2910,18 @@ reg_dead_after_loop (const struct loop *loop, rtx reg)
              set = single_set (insn);
              if (set && rtx_equal_p (SET_DEST (set), reg))
                break;
-           }
 
-         if (code == JUMP_INSN)
-           {
-             if (GET_CODE (PATTERN (insn)) == RETURN)
-               break;
-             else if (!any_uncondjump_p (insn)
-                      /* Prevent infinite loop following infinite loops.  */
-                      || jump_count++ > 20)
-               return 0;
-             else
-               insn = JUMP_LABEL (insn);
+             if (JUMP_P (insn))
+               {
+                 if (GET_CODE (PATTERN (insn)) == RETURN)
+                   break;
+                 else if (!any_uncondjump_p (insn)
+                          /* Prevent infinite loop following infinite loops.  */
+                          || jump_count++ > 20)
+                   return 0;
+                 else
+                   insn = JUMP_LABEL (insn);
+               }
            }
 
          insn = NEXT_INSN (insn);
@@ -3151,7 +3144,7 @@ loop_find_equiv_value (const struct loop *loop, rtx reg)
   ret = reg;
   for (insn = PREV_INSN (loop_start); insn; insn = PREV_INSN (insn))
     {
-      if (GET_CODE (insn) == CODE_LABEL)
+      if (LABEL_P (insn))
        break;
 
       else if (INSN_P (insn) && reg_set_p (reg, insn))
@@ -3217,8 +3210,8 @@ subtract_reg_term (rtx op, rtx reg)
 static rtx
 find_common_reg_term (rtx op0, rtx op1)
 {
-  if ((GET_CODE (op0) == REG || GET_CODE (op0) == PLUS)
-      && (GET_CODE (op1) == REG || GET_CODE (op1) == PLUS))
+  if ((REG_P (op0) || GET_CODE (op0) == PLUS)
+      && (REG_P (op1) || GET_CODE (op1) == PLUS))
     {
       rtx op00;
       rtx op01;
@@ -3288,7 +3281,7 @@ loop_iterations (struct loop *loop)
   /* ??? We should probably try harder to find the jump insn
      at the end of the loop.  The following code assumes that
      the last loop insn is a jump to the top of the loop.  */
-  if (GET_CODE (last_loop_insn) != JUMP_INSN)
+  if (!JUMP_P (last_loop_insn))
     {
       if (loop_dump_stream)
        fprintf (loop_dump_stream,
@@ -3314,7 +3307,7 @@ loop_iterations (struct loop *loop)
 
       do
        {
-         if (GET_CODE (temp) == JUMP_INSN)
+         if (JUMP_P (temp))
            {
              /* There are some kinds of jumps we can't deal with easily.  */
              if (JUMP_LABEL (temp) == 0)
@@ -3364,7 +3357,7 @@ loop_iterations (struct loop *loop)
   iteration_var = XEXP (comparison, 0);
   comparison_value = XEXP (comparison, 1);
 
-  if (GET_CODE (iteration_var) != REG)
+  if (!REG_P (iteration_var))
     {
       if (loop_dump_stream)
        fprintf (loop_dump_stream,
@@ -3426,7 +3419,7 @@ loop_iterations (struct loop *loop)
   /* Try swapping the comparison to identify a suitable iv.  */
   if (REG_IV_TYPE (ivs, REGNO (iteration_var)) != BASIC_INDUCT
       && REG_IV_TYPE (ivs, REGNO (iteration_var)) != GENERAL_INDUCT
-      && GET_CODE (comparison_value) == REG
+      && REG_P (comparison_value)
       && REGNO (comparison_value) < ivs->n_regs)
     {
       rtx temp = comparison_value;
@@ -3574,7 +3567,7 @@ loop_iterations (struct loop *loop)
      its value from the insns before the start of the loop.  */
 
   final_value = comparison_value;
-  if (GET_CODE (comparison_value) == REG
+  if (REG_P (comparison_value)
       && loop_invariant_p (loop, comparison_value))
     {
       final_value = loop_find_equiv_value (loop, comparison_value);
@@ -3719,7 +3712,7 @@ loop_iterations (struct loop *loop)
       /* If we have a REG, check to see if REG holds a constant value.  */
       /* ??? Other RTL, such as (neg (reg)) is possible here, but it isn't
         clear if it is worthwhile to try to handle such RTL.  */
-      if (GET_CODE (increment) == REG || GET_CODE (increment) == SUBREG)
+      if (REG_P (increment) || GET_CODE (increment) == SUBREG)
        increment = loop_find_equiv_value (loop, increment);
 
       if (GET_CODE (increment) != CONST_INT)
@@ -3973,7 +3966,7 @@ set_dominates_use (int regno, int first_uid, int last_uid, rtx copy_start,
 
   while (INSN_UID (p) != first_uid)
     {
-      if (GET_CODE (p) == JUMP_INSN)
+      if (JUMP_P (p))
        passed_jump = 1;
       /* Could not find FIRST_UID.  */
       if (p == copy_end)
@@ -3993,7 +3986,7 @@ set_dominates_use (int regno, int first_uid, int last_uid, rtx copy_start,
     {
       /* If we see a CODE_LABEL between FIRST_UID and LAST_UID, then we
         can not be sure that FIRST_UID dominates LAST_UID.  */
-      if (GET_CODE (p) == CODE_LABEL)
+      if (LABEL_P (p))
        return 0;
       /* Could not find LAST_UID, but we reached the end of the loop, so
         it must be safe.  */
@@ -4030,7 +4023,7 @@ ujump_to_loop_cont (rtx loop_start, rtx loop_cont)
 
   /* Examine insn after loop continuation note.  Return if not a label.  */
   label = next_nonnote_insn (loop_cont);
-  if (label == 0 || GET_CODE (label) != CODE_LABEL)
+  if (label == 0 || !LABEL_P (label))
     return NULL_RTX;
 
   /* Return the loop start if the branch label matches the code label.  */