OSDN Git Service

* gcc.dg/tree-ssa/20040204-1.c: Remove powerpc from xfail list.
[pf3gnuchains/gcc-fork.git] / gcc / reorg.c
index dbe075a..763f07b 100644 (file)
@@ -1,6 +1,6 @@
 /* Perform instruction reorganizations for delay slot filling.
    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-   1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+   1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu).
    Hacked by Michael Tiemann (tiemann@cygnus.com).
 
@@ -253,7 +253,7 @@ stop_search_p (rtx insn, int labels_p)
              || asm_noperands (PATTERN (insn)) >= 0);
 
     default:
-      abort ();
+      gcc_unreachable ();
     }
 }
 \f
@@ -420,7 +420,12 @@ find_end_label (void)
             if needed.  */
          emit_label (end_of_function_label);
 #ifdef HAVE_return
-         if (HAVE_return)
+         /* We don't bother trying to create a return insn if the
+            epilogue has filled delay-slots; we would have to try and
+            move the delay-slot fillers to the delay-slots for the new
+            return insn or in front of the new return insn.  */
+         if (current_function_epilogue_delay_list == NULL
+             && HAVE_return)
            {
              /* The return we make may have delay slots too.  */
              rtx insn = gen_return ();
@@ -564,8 +569,7 @@ emit_delay_sequence (rtx insn, rtx list, int length)
   if (had_barrier)
     emit_barrier_after (seq_insn);
 
-  if (i != length + 1)
-    abort ();
+  gcc_assert (i == length + 1);
 
   return seq_insn;
 }
@@ -887,7 +891,7 @@ get_jump_flags (rtx insn, rtx label)
          break;
 
        default:
-         abort ();
+         gcc_unreachable ();
        }
     }
   else
@@ -999,16 +1003,6 @@ mostly_true_jump (rtx jump_insn, rtx condition)
           insn = PREV_INSN (insn))
        if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_BEG)
          return 2;
-
-      /* If this is a jump to the test of a loop, it is likely true.  We scan
-        forwards from the target label.  If we find a NOTE_INSN_LOOP_VTOP
-        before the next real insn, we assume the branch is to the loop branch
-        test.  */
-      for (insn = NEXT_INSN (target_label);
-          insn && NOTE_P (insn);
-          insn = PREV_INSN (insn))
-       if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_VTOP)
-         return 1;
     }
 
   /* Look at the relative rarities of the fallthrough and destination.  If
@@ -2559,9 +2553,8 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
   int flags;
 
   /* Validate our arguments.  */
-  if ((condition == const_true_rtx && ! thread_if_true)
-      || (! own_thread && ! thread_if_true))
-    abort ();
+  gcc_assert(condition != const_true_rtx || thread_if_true);
+  gcc_assert(own_thread || thread_if_true);
 
   flags = get_jump_flags (insn, JUMP_LABEL (insn));
 
@@ -2931,8 +2924,7 @@ fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
     {
       rtx label;
 
-      if (! thread_if_true)
-       abort ();
+      gcc_assert (thread_if_true);
 
       if (new_thread && JUMP_P (new_thread)
          && (simplejump_p (new_thread)
@@ -3238,8 +3230,7 @@ relax_delay_slots (rtx first)
 
          trial = PREV_INSN (insn);
          delete_related_insns (insn);
-         if (GET_CODE (pat) != SEQUENCE)
-           abort ();
+         gcc_assert (GET_CODE (pat) == SEQUENCE);
          after = trial;
          for (i = 0; i < XVECLEN (pat, 0); i++)
            {
@@ -3357,8 +3348,7 @@ relax_delay_slots (rtx first)
 
          trial = PREV_INSN (insn);
          delete_related_insns (insn);
-         if (GET_CODE (pat) != SEQUENCE)
-           abort ();
+         gcc_assert (GET_CODE (pat) == SEQUENCE);
          after = trial;
          for (i = 0; i < XVECLEN (pat, 0); i++)
            {