+Wed Sep 30 18:29:26 1998 Jeffrey A Law (law@cygnus.com)
+
+ * loop.c (check_dbra_loop): Use a vanilla loop reversal if the biv is
+ used to compute a giv or as some other non-counting use.
+
Wed Sep 30 18:19:27 1998 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* regs.h (HARD_REGNO_CALLER_SAVE_MODE): New macro.
if (initial_value == const0_rtx
/* If we have a decrement_and_branch_on_count, prefer
the NE test, since this will allow that instruction to
- be generated. */
+ be generated. Note that we must use a vanilla loop
+ reversal if the biv is used to calculate a giv or has
+ a non-counting use. */
#if ! defined (HAVE_decrement_and_branch_until_zero) && defined (HAVE_decrement_and_branch_on_count)
- && (add_val != 1 || ! vtop)
+ && (! (add_val == 1 && vtop
+ && (bl->biv_count == 0
+ || no_use_except_counting)))
#endif
&& GET_CODE (comparison_value) == CONST_INT
/* Now do postponed overflow checks on COMPARISON_VAL. */
nonneg = 1;
cmp_code = GE;
}
- else if (add_val == 1 && vtop)
+ else if (add_val == 1 && vtop
+ && (bl->biv_count == 0
+ || no_use_except_counting))
{
add_adjust = 0;
cmp_code = NE;