]> gcc.gnu.org Git - gcc.git/commitdiff
(final_giv_value): Verify that bl->initial_value is
authorJim Wilson <wilson@gcc.gnu.org>
Wed, 25 Jun 1997 23:53:40 +0000 (16:53 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 25 Jun 1997 23:53:40 +0000 (16:53 -0700)
invariant before trying to use it.

From-SVN: r14323

gcc/unroll.c

index 3f5c548994fa0496b56ddc42258e91c0816e23be..23bf6d372c1a2e8ad185e7480b4bdcab8dc4f053 100644 (file)
@@ -3205,9 +3205,14 @@ final_giv_value (v, loop_start, loop_end)
         determine whether giv's are replaceable so that we can use the
         biv value here if it is not eliminable.  */
 
+      /* We are emitting code after the end of the loop, so we must make
+        sure that bl->initial_value is still valid then.  It will still
+        be valid if it is invariant.  */
+
       increment = biv_total_increment (bl, loop_start, loop_end);
 
-      if (increment && invariant_p (increment))
+      if (increment && invariant_p (increment)
+         && invariant_p (bl->initial_value))
        {
          /* Can calculate the loop exit value of its biv as
             (loop_n_iterations * increment) + initial_value */
This page took 0.062851 seconds and 5 git commands to generate.