OSDN Git Service

* gcc.dg/vect/vect-78.c: Now vectorized on powerpc*.
[pf3gnuchains/gcc-fork.git] / gcc / jump.c
index c69a489..ed6ef1e 100644 (file)
@@ -90,7 +90,7 @@ rebuild_jump_labels (rtx f)
      count doesn't drop to zero.  */
 
   for (insn = forced_labels; insn; insn = XEXP (insn, 1))
-    if (GET_CODE (XEXP (insn, 0)) == CODE_LABEL)
+    if (LABEL_P (XEXP (insn, 0)))
       LABEL_NUSES (XEXP (insn, 0))++;
   timevar_pop (TV_REBUILD_JUMP);
 }
@@ -110,11 +110,11 @@ cleanup_barriers (void)
   for (insn = get_insns (); insn; insn = next)
     {
       next = NEXT_INSN (insn);
-      if (GET_CODE (insn) == BARRIER)
+      if (BARRIER_P (insn))
        {
          prev = prev_nonnote_insn (insn);
-         if (GET_CODE (prev) == BARRIER)
-           delete_barrier (insn);
+         if (BARRIER_P (prev))
+           delete_insn (insn);
          else if (prev != PREV_INSN (insn))
            reorder_insns (insn, insn, prev);
        }
@@ -132,7 +132,7 @@ purge_line_number_notes (rtx f)
      even if it became empty.  */
 
   for (insn = f; insn; insn = NEXT_INSN (insn))
-    if (GET_CODE (insn) == NOTE)
+    if (NOTE_P (insn))
       {
        if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_BEG)
          /* Any previous line note was for the prologue; gdb wants a new
@@ -142,8 +142,13 @@ purge_line_number_notes (rtx f)
          {
            /* Delete this note if it is identical to previous note.  */
            if (last_note
+#ifdef USE_MAPPED_LOCATION
+               && NOTE_SOURCE_LOCATION (insn) == NOTE_SOURCE_LOCATION (last_note)
+#else
                && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last_note)
-               && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note))
+               && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last_note)
+#endif
+)
              {
                delete_related_insns (insn);
                continue;
@@ -163,11 +168,11 @@ init_label_info (rtx f)
   rtx insn;
 
   for (insn = f; insn; insn = NEXT_INSN (insn))
-    if (GET_CODE (insn) == CODE_LABEL)
+    if (LABEL_P (insn))
       LABEL_NUSES (insn) = (LABEL_PRESERVE_P (insn) != 0);
-    else if (GET_CODE (insn) == JUMP_INSN)
+    else if (JUMP_P (insn))
       JUMP_LABEL (insn) = 0;
-    else if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
+    else if (NONJUMP_INSN_P (insn) || CALL_P (insn))
       {
        rtx note, next;
 
@@ -193,7 +198,7 @@ mark_all_labels (rtx f)
     if (INSN_P (insn))
       {
        mark_jump_label (PATTERN (insn), insn, 0);
-       if (! INSN_DELETED_P (insn) && GET_CODE (insn) == JUMP_INSN)
+       if (! INSN_DELETED_P (insn) && JUMP_P (insn))
          {
            /* When we know the LABEL_REF contained in a REG used in
               an indirect jump, we'll have a REG_LABEL note so that
@@ -237,13 +242,11 @@ squeeze_notes (rtx* startp, rtx* endp)
   for (insn = start; insn != past_end; insn = next)
     {
       next = NEXT_INSN (insn);
-      if (GET_CODE (insn) == NOTE
+      if (NOTE_P (insn)
          && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_END
              || NOTE_LINE_NUMBER (insn) == NOTE_INSN_BLOCK_BEG
              || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG
-             || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END
-             || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_CONT
-             || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_VTOP))
+             || NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END))
        {
          if (insn == start)
            start = next;
@@ -284,7 +287,7 @@ get_label_before (rtx insn)
      or make a new one if there is none.  */
   label = prev_nonnote_insn (insn);
 
-  if (label == 0 || GET_CODE (label) != CODE_LABEL)
+  if (label == 0 || !LABEL_P (label))
     {
       rtx prev = PREV_INSN (insn);
 
@@ -306,7 +309,7 @@ get_label_after (rtx insn)
      or make a new one if there is none.  */
   label = next_nonnote_insn (insn);
 
-  if (label == 0 || GET_CODE (label) != CODE_LABEL)
+  if (label == 0 || !LABEL_P (label))
     {
       label = gen_label_rtx ();
       emit_label_after (label, insn);
@@ -388,7 +391,7 @@ reversed_comparison_code_parts (enum rtx_code code, rtx arg0, rtx arg1, rtx insn
        return UNKNOWN;
 
       for (prev = prev_nonnote_insn (insn);
-          prev != 0 && GET_CODE (prev) != CODE_LABEL;
+          prev != 0 && !LABEL_P (prev);
           prev = prev_nonnote_insn (prev))
        {
          rtx set = set_of (arg0, prev);
@@ -731,7 +734,7 @@ comparison_dominates_p (enum rtx_code code1, enum rtx_code code2)
 int
 simplejump_p (rtx insn)
 {
-  return (GET_CODE (insn) == JUMP_INSN
+  return (JUMP_P (insn)
          && GET_CODE (PATTERN (insn)) == SET
          && GET_CODE (SET_DEST (PATTERN (insn))) == PC
          && GET_CODE (SET_SRC (PATTERN (insn))) == LABEL_REF);
@@ -808,7 +811,7 @@ rtx
 pc_set (rtx insn)
 {
   rtx pat;
-  if (GET_CODE (insn) != JUMP_INSN)
+  if (!JUMP_P (insn))
     return NULL_RTX;
   pat = PATTERN (insn);
 
@@ -898,7 +901,7 @@ returnjump_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
 int
 returnjump_p (rtx insn)
 {
-  if (GET_CODE (insn) != JUMP_INSN)
+  if (!JUMP_P (insn))
     return 0;
   return for_each_rtx (&PATTERN (insn), returnjump_p_1, NULL);
 }
@@ -911,7 +914,7 @@ onlyjump_p (rtx insn)
 {
   rtx set;
 
-  if (GET_CODE (insn) != JUMP_INSN)
+  if (!JUMP_P (insn))
     return 0;
 
   set = single_set (insn);
@@ -998,12 +1001,12 @@ follow_jumps (rtx label)
   for (depth = 0;
        (depth < 10
        && (insn = next_active_insn (value)) != 0
-       && GET_CODE (insn) == JUMP_INSN
+       && JUMP_P (insn)
        && ((JUMP_LABEL (insn) != 0 && any_uncondjump_p (insn)
             && onlyjump_p (insn))
            || GET_CODE (PATTERN (insn)) == RETURN)
        && (next = NEXT_INSN (insn))
-       && GET_CODE (next) == BARRIER);
+       && BARRIER_P (next));
        depth++)
     {
       /* Don't chain through the insn that jumps into a loop
@@ -1013,7 +1016,7 @@ follow_jumps (rtx label)
       rtx tem;
       if (!reload_completed)
        for (tem = value; tem != insn; tem = NEXT_INSN (tem))
-         if (GET_CODE (tem) == NOTE
+         if (NOTE_P (tem)
              && (NOTE_LINE_NUMBER (tem) == NOTE_INSN_LOOP_BEG
                  /* ??? Optional.  Disables some optimizations, but makes
                     gcov output more accurate with -O.  */
@@ -1087,11 +1090,11 @@ mark_jump_label (rtx x, rtx insn, int in_mem)
 
        /* Ignore remaining references to unreachable labels that
           have been deleted.  */
-       if (GET_CODE (label) == NOTE
+       if (NOTE_P (label)
            && NOTE_LINE_NUMBER (label) == NOTE_INSN_DELETED_LABEL)
          break;
 
-       if (GET_CODE (label) != CODE_LABEL)
+       if (!LABEL_P (label))
          abort ();
 
        /* Ignore references to labels of containing functions.  */
@@ -1104,7 +1107,7 @@ mark_jump_label (rtx x, rtx insn, int in_mem)
 
        if (insn)
          {
-           if (GET_CODE (insn) == JUMP_INSN)
+           if (JUMP_P (insn))
              JUMP_LABEL (insn) = label;
            else
              {
@@ -1164,17 +1167,6 @@ delete_jump (rtx insn)
     delete_computation (insn);
 }
 
-/* Verify INSN is a BARRIER and delete it.  */
-
-void
-delete_barrier (rtx insn)
-{
-  if (GET_CODE (insn) != BARRIER)
-    abort ();
-
-  delete_insn (insn);
-}
-
 /* Recursively delete prior insns that compute the value (used only by INSN
    which the caller is deleting) stored in the register mentioned by NOTE
    which is a REG_DEAD note associated with INSN.  */
@@ -1186,15 +1178,15 @@ delete_prior_computation (rtx note, rtx insn)
   rtx reg = XEXP (note, 0);
 
   for (our_prev = prev_nonnote_insn (insn);
-       our_prev && (GET_CODE (our_prev) == INSN
-                   || GET_CODE (our_prev) == CALL_INSN);
+       our_prev && (NONJUMP_INSN_P (our_prev)
+                   || CALL_P (our_prev));
        our_prev = prev_nonnote_insn (our_prev))
     {
       rtx pat = PATTERN (our_prev);
 
       /* If we reach a CALL which is not calling a const function
         or the callee pops the arguments, then give up.  */
-      if (GET_CODE (our_prev) == CALL_INSN
+      if (CALL_P (our_prev)
          && (! CONST_OR_PURE_CALL_P (our_prev)
              || GET_CODE (pat) != SET || GET_CODE (SET_SRC (pat)) != CALL))
        break;
@@ -1207,14 +1199,14 @@ delete_prior_computation (rtx note, rtx insn)
        break;
 
       if (GET_CODE (pat) == USE
-         && GET_CODE (XEXP (pat, 0)) == INSN)
+         && NONJUMP_INSN_P (XEXP (pat, 0)))
        /* reorg creates USEs that look like this.  We leave them
           alone because reorg needs them for its own purposes.  */
        break;
 
       if (reg_set_p (reg, pat))
        {
-         if (side_effects_p (pat) && GET_CODE (our_prev) != CALL_INSN)
+         if (side_effects_p (pat) && !CALL_P (our_prev))
            break;
 
          if (GET_CODE (pat) == PARALLEL)
@@ -1320,7 +1312,7 @@ delete_computation (rtx insn)
         will use them.  So if the previous insn
         exists to set the CC's, delete it
         (unless it performs auto-increments, etc.).  */
-      if (prev && GET_CODE (prev) == INSN
+      if (prev && NONJUMP_INSN_P (prev)
          && sets_cc0_p (PATTERN (prev)))
        {
          if (sets_cc0_p (PATTERN (prev)) > 0
@@ -1360,7 +1352,7 @@ delete_computation (rtx insn)
 rtx
 delete_related_insns (rtx insn)
 {
-  int was_code_label = (GET_CODE (insn) == CODE_LABEL);
+  int was_code_label = (LABEL_P (insn));
   rtx note;
   rtx next = NEXT_INSN (insn), prev = PREV_INSN (insn);
 
@@ -1376,13 +1368,13 @@ delete_related_insns (rtx insn)
   /* If instruction is followed by a barrier,
      delete the barrier too.  */
 
-  if (next != 0 && GET_CODE (next) == BARRIER)
+  if (next != 0 && BARRIER_P (next))
     delete_insn (next);
 
   /* If deleting a jump, decrement the count of the label,
      and delete the label if it is now unused.  */
 
-  if (GET_CODE (insn) == JUMP_INSN && JUMP_LABEL (insn))
+  if (JUMP_P (insn) && JUMP_LABEL (insn))
     {
       rtx lab = JUMP_LABEL (insn), lab_next;
 
@@ -1413,7 +1405,7 @@ delete_related_insns (rtx insn)
 
   /* Likewise if we're deleting a dispatch table.  */
 
-  if (GET_CODE (insn) == JUMP_INSN
+  if (JUMP_P (insn)
       && (GET_CODE (PATTERN (insn)) == ADDR_VEC
          || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC))
     {
@@ -1430,15 +1422,15 @@ delete_related_insns (rtx insn)
     }
 
   /* Likewise for an ordinary INSN / CALL_INSN with a REG_LABEL note.  */
-  if (GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN)
+  if (NONJUMP_INSN_P (insn) || CALL_P (insn))
     for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
       if (REG_NOTE_KIND (note) == REG_LABEL
          /* This could also be a NOTE_INSN_DELETED_LABEL note.  */
-         && GET_CODE (XEXP (note, 0)) == CODE_LABEL)
+         && LABEL_P (XEXP (note, 0)))
        if (LABEL_NUSES (XEXP (note, 0)) == 0)
          delete_related_insns (XEXP (note, 0));
 
-  while (prev && (INSN_DELETED_P (prev) || GET_CODE (prev) == NOTE))
+  while (prev && (INSN_DELETED_P (prev) || NOTE_P (prev)))
     prev = PREV_INSN (prev);
 
   /* If INSN was a label and a dispatch table follows it,
@@ -1447,14 +1439,14 @@ delete_related_insns (rtx insn)
 
   if (was_code_label
       && NEXT_INSN (insn) != 0
-      && GET_CODE (NEXT_INSN (insn)) == JUMP_INSN
+      && JUMP_P (NEXT_INSN (insn))
       && (GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_VEC
          || GET_CODE (PATTERN (NEXT_INSN (insn))) == ADDR_DIFF_VEC))
     next = delete_related_insns (NEXT_INSN (insn));
 
   /* If INSN was a label, delete insns following it if now unreachable.  */
 
-  if (was_code_label && prev && GET_CODE (prev) == BARRIER)
+  if (was_code_label && prev && BARRIER_P (prev))
     {
       enum rtx_code code;
       while (next)
@@ -1495,7 +1487,7 @@ delete_for_peephole (rtx from, rtx to)
       rtx next = NEXT_INSN (insn);
       rtx prev = PREV_INSN (insn);
 
-      if (GET_CODE (insn) != NOTE)
+      if (!NOTE_P (insn))
        {
          INSN_DELETED_P (insn) = 1;
 
@@ -1667,7 +1659,7 @@ redirect_jump (rtx jump, rtx nlabel, int delete_unused)
      function, move the function end note so that -Wreturn-type works.  */
   if (olabel && nlabel
       && NEXT_INSN (olabel)
-      && GET_CODE (NEXT_INSN (olabel)) == NOTE
+      && NOTE_P (NEXT_INSN (olabel))
       && NOTE_LINE_NUMBER (NEXT_INSN (olabel)) == NOTE_INSN_FUNCTION_END)
     emit_note_after (NOTE_INSN_FUNCTION_END, nlabel);