OSDN Git Service

2005-02-15 Eric Christopher <echristo@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / reorg.c
index d464a32..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
@@ -2549,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));
 
@@ -2921,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)
@@ -3228,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++)
            {
@@ -3347,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++)
            {