loop.c (check_dbra_loop): Enable code for reversal of some loops without a known...
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Thu, 27 Aug 1998 08:39:22 +0000 (08:39 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Thu, 27 Aug 1998 08:39:22 +0000 (09:39 +0100)
* loop.c (check_dbra_loop): Enable code for reversal
of some loops without a known constant loop end.

From-SVN: r22019

gcc/ChangeLog
gcc/loop.c

index aef593f10f196aeff99371894aa17acee3695ae7..e4db16f17e00e3c5f33aee702e58d406583e6cc8 100644 (file)
@@ -1,3 +1,8 @@
+Thu Aug 27 16:34:51 1998  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * loop.c (check_dbra_loop): Enable code for reversal
+       of some loops without a known constant loop end.
+
 Wed Aug 26 18:38:15 1998  Richard Henderson  <rth@cygnus.com>
 
         * haifa-sched.c (last_clock_var): New.
index a34106df26b3f2d619b453cd1230e99defa597a6..f11caebeb81c09be4371561d753fec8158c97575 100644 (file)
@@ -6931,7 +6931,6 @@ check_dbra_loop (loop_end, insn_count, loop_start)
                  initial_value = const0_rtx;
                }
 
-#if 0
              /* Check if there is a NOTE_INSN_LOOP_VTOP note.  If there is,
                 that means that this is a for or while style loop, with
                 a loop exit test at the start.  Thus, we can assume that
@@ -6944,12 +6943,12 @@ check_dbra_loop (loop_end, insn_count, loop_start)
              vtop = loop_end;
              do
                vtop = PREV_INSN (vtop);
-             while (GET_CODE (vtop) != NOTE);
+             while (GET_CODE (vtop) != NOTE
+                    || NOTE_LINE_NUMBER (vtop) > 0
+                    || NOTE_LINE_NUMBER (vtop) == NOTE_REPEATED_LINE_NUMBER
+                    || NOTE_LINE_NUMBER (vtop) == NOTE_INSN_DELETED);
              if (NOTE_LINE_NUMBER (vtop) != NOTE_INSN_LOOP_VTOP)
                vtop = NULL_RTX;
-#else
-             vtop = NULL_RTX;
-#endif
                
              /* First check if we can do a vanilla loop reversal.  */
              if (initial_value == const0_rtx