(find_splittable_regs): When completely unrolling loop, check for
authorRichard Kenner <kenner@gcc.gnu.org>
Mon, 26 Jun 1995 23:17:37 +0000 (19:17 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Mon, 26 Jun 1995 23:17:37 +0000 (19:17 -0400)
non-invariant initial biv values.

From-SVN: r10056

gcc/unroll.c

index 0d6e69302346fe0a3c79fa90f2cd9bc0fe75d61d..76543d9f11b85438c54e7d097212f29e2d7081c9 100644 (file)
@@ -2397,12 +2397,13 @@ find_splittable_regs (unroll_type, loop_start, loop_end, end_insert_before,
            {
              /* If the initial value of the biv is itself (i.e. it is too
                 complicated for strength_reduce to compute), or is a hard
-                register, then we must create a new pseudo reg to hold the
-                initial value of the biv.  */
+                register, or it isn't invariant, then we must create a new
+                pseudo reg to hold the initial value of the biv.  */
 
              if (GET_CODE (bl->initial_value) == REG
                  && (REGNO (bl->initial_value) == bl->regno
-                     || REGNO (bl->initial_value) < FIRST_PSEUDO_REGISTER))
+                     || REGNO (bl->initial_value) < FIRST_PSEUDO_REGISTER
+                     || ! invariant_p (bl->initial_value)))
                {
                  rtx tem = gen_reg_rtx (bl->biv->mode);