]> gcc.gnu.org Git - gcc.git/commitdiff
Fix loop reversal bug reported by Joern Rennecke.
authorJim Wilson <wilson@cygnus.com>
Tue, 7 Apr 1998 12:00:13 +0000 (12:00 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 7 Apr 1998 12:00:13 +0000 (05:00 -0700)
* loop.c (check_dbra_loop): When normalize comparison_val, add check
to verify it is non-negative.

From-SVN: r19030

gcc/ChangeLog
gcc/loop.c

index 3f87f3f66a1a1539c9d92fe4b2fc912ba3c05434..58ec0effa89806205479aaf1450f8dfdf7968e3b 100644 (file)
@@ -1,3 +1,8 @@
+Tue Apr  7 11:58:04 1998  Jim Wilson  <wilson@cygnus.com>
+
+       * loop.c (check_dbra_loop): When normalize comparison_val, add check
+       to verify it is non-negative.
+
 Tue Apr  7 02:01:47 1998  Richard Henderson  <rth@cygnus.com>
 
        * alpha.c (alpha_expand_block_move): Correctly collect block offsets.
index d46ca6488348e877d34aa37c4759f2f9231465f1..a3f7a8f59bc155420a50a9c70cf6270bd9079c76 100644 (file)
@@ -6281,7 +6281,10 @@ check_dbra_loop (loop_end, insn_count, loop_start)
                  && GET_CODE (initial_value) == CONST_INT)
                {
                  comparison_val = comparison_val - INTVAL (bl->initial_value);
-                 initial_value = const0_rtx;
+                 /* Check for overflow.  If comparison_val ends up as a
+                    negative value, then we can't reverse the loop.  */
+                 if (comparison_val >= 0)
+                   initial_value = const0_rtx;
                }
 
              /* If the initial value is not zero, or if the comparison
This page took 0.094495 seconds and 5 git commands to generate.