From f3da3e9abb8f46566f1e7e8c4264582d30f003bc Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 9 Aug 2005 08:22:53 +0000 Subject: [PATCH] re PR rtl-optimization/17860 ([3.4 only] Wrong generated code for loop with varying bound) 2005-08-09 Paolo Bonzini PR rtl-optimization/17860 * loop.c (check_dbra_loop): Do not try to use an end condition like "i != 0" in the reversed loop. From-SVN: r102904 --- gcc/ChangeLog | 6 ++++++ gcc/loop.c | 18 ------------------ 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ef76da76c474..5d9052ca6fbe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-08-09 Paolo Bonzini + + PR rtl-optimization/17860 + * loop.c (check_dbra_loop): Do not try to use an end condition + like "i != 0" in the reversed loop. + 2005-08-08 Josh Conner PR rtl-optimization/23241 diff --git a/gcc/loop.c b/gcc/loop.c index 4ddd77acf796..fa74b8e32301 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -8396,17 +8396,6 @@ check_dbra_loop (struct loop *loop, int insn_count) /* First check if we can do a vanilla loop reversal. */ 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. 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 && loop->vtop - && (bl->biv_count == 0 - || no_use_except_counting))) -#endif && GET_CODE (comparison_value) == CONST_INT /* Now do postponed overflow checks on COMPARISON_VAL. */ && ! (((comparison_val - add_val) ^ INTVAL (comparison_value)) @@ -8418,13 +8407,6 @@ check_dbra_loop (struct loop *loop, int insn_count) nonneg = 1; cmp_code = GE; } - else if (add_val == 1 && loop->vtop - && (bl->biv_count == 0 - || no_use_except_counting)) - { - add_adjust = 0; - cmp_code = NE; - } else return 0; -- 2.47.2