]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/17860 ([3.4 only] Wrong generated code for loop with varying...
authorPaolo Bonzini <bonzini@gnu.org>
Tue, 9 Aug 2005 08:22:53 +0000 (08:22 +0000)
committerPaolo Bonzini <bonzini@gcc.gnu.org>
Tue, 9 Aug 2005 08:22:53 +0000 (08:22 +0000)
2005-08-09  Paolo Bonzini  <bonzini@gnu.org>

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
gcc/loop.c

index ef76da76c4742ec4b076765195bb957c5ff70523..5d9052ca6fbea9b45bf636a440505c45b45989c0 100644 (file)
@@ -1,3 +1,9 @@
+2005-08-09  Paolo Bonzini  <bonzini@gnu.org>
+
+       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  <jconner@apple.com>
 
        PR rtl-optimization/23241
index 4ddd77acf7968d98c4a224b4137ae3d98db1f3c7..fa74b8e32301ecf2f4d4251193ea806d9af50715 100644 (file)
@@ -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;