loop.c (check_dbra_loop): A biv has uses besides counting if it is used to set anothe...
authorFranz Sirl <Franz.Sirl-kernel@lauterbach.com>
Sun, 25 Feb 2001 00:08:01 +0000 (00:08 +0000)
committerFranz Sirl <sirl@gcc.gnu.org>
Sun, 25 Feb 2001 00:08:01 +0000 (00:08 +0000)
        2001-02-24  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>

        * loop.c (check_dbra_loop): A biv has uses besides counting if it is
        used to set another biv.

From-SVN: r40042

gcc/ChangeLog
gcc/loop.c

index 00ce4bd434847b63978d9e57c24d9e20efa596c2..d363794c0768596c77ab4251e765ecf01d35d6e7 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-24  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+       * loop.c (check_dbra_loop): A biv has uses besides counting if it is
+       used to set another biv.
+
 Sat Feb 24 06:45:21 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * tree.h (BLOCK_DEAD): New macro.
index 252e27eb087739e4510fd813c399fe8dca294911..7eb4d0df4502615b6bff8ba228efb6ec18595e0b 100644 (file)
@@ -7259,6 +7259,7 @@ check_dbra_loop (loop, insn_count)
       if (bl->giv_count == 0 && ! loop->exit_count)
        {
          rtx bivreg = regno_reg_rtx[bl->regno];
+         struct iv_class *blt;
 
          /* If there are no givs for this biv, and the only exit is the
             fall through at the end of the loop, then
@@ -7295,6 +7296,14 @@ check_dbra_loop (loop, insn_count)
                    break;
                  }
              }
+
+         /* A biv has uses besides counting if it is used to set another biv.  */
+         for (blt = ivs->list; blt; blt = blt->next)
+           if (blt->init_set && reg_mentioned_p (bivreg, SET_SRC (blt->init_set)))
+             {
+               no_use_except_counting = 0;
+               break;
+             }
        }
 
       if (no_use_except_counting)