/* 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).
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA. */
/* Instruction reorganization pass.
|| asm_noperands (PATTERN (insn)) >= 0);
default:
- abort ();
+ gcc_unreachable ();
}
}
\f
/* If the basic block reorder pass moves the return insn to
some other place try to locate it again and put our
end_of_function_label there. */
- while (insn && ! (GET_CODE (insn) == JUMP_INSN
+ while (insn && ! (JUMP_P (insn)
&& (GET_CODE (PATTERN (insn)) == RETURN)))
insn = PREV_INSN (insn);
if (insn)
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 ();
if (had_barrier)
emit_barrier_after (seq_insn);
- if (i != length + 1)
- abort ();
+ gcc_assert (i == length + 1);
return seq_insn;
}
break;
default:
- abort ();
+ gcc_unreachable ();
}
}
else
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
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));
{
rtx label;
- if (! thread_if_true)
- abort ();
+ gcc_assert (thread_if_true);
if (new_thread && JUMP_P (new_thread)
&& (simplejump_p (new_thread)
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++)
{
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++)
{
annulled jumps, though. Again, don't convert a jump to a RETURN
here. */
if (! INSN_ANNULLED_BRANCH_P (delay_insn)
+ && any_condjump_p (delay_insn)
&& next && JUMP_P (next)
&& (simplejump_p (next) || GET_CODE (PATTERN (next)) == RETURN)
&& next_active_insn (target_label) == next_active_insn (next)
{
rtx insn, next, epilogue_insn = 0;
int i;
-#if 0
- int old_flag_no_peephole = flag_no_peephole;
-
- /* Execute `final' once in prescan mode to delete any insns that won't be
- used. Don't let final try to do any peephole optimization--it will
- ruin dataflow information for this pass. */
-
- flag_no_peephole = 1;
- final (first, 0, NO_DEBUG, 1, 1);
- flag_no_peephole = old_flag_no_peephole;
-#endif
/* If the current function has no insns other than the prologue and
epilogue, then do not try to fill any delay slots. */