(strength_reduce): Don't ignore a giv that depends on a
authorJim Wilson <wilson@gcc.gnu.org>
Wed, 28 Jul 1993 17:50:26 +0000 (10:50 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 28 Jul 1993 17:50:26 +0000 (10:50 -0700)
reversed biv.

From-SVN: r5025

gcc/loop.c

index 1d1c03abe67da21157404f998199ab031124e370..d51fff7276f92596cca3a84ad049155b5177f280 100644 (file)
@@ -3708,7 +3708,14 @@ strength_reduce (scan_start, end, loop_top, insn_count,
          /* If an insn is not to be strength reduced, then set its ignore
             flag, and clear all_reduced.  */
 
-         if (v->lifetime * threshold * benefit < insn_count)
+         /* A giv that depends on a reversed biv must be reduced if it is
+            used after the loop exit, otherwise, it would have the wrong
+            value after the loop exit.  To make it simple, just reduce all
+            of such giv's whether or not we know they are used after the loop
+            exit.  */
+
+         if (v->lifetime * threshold * benefit < insn_count
+             && ! bl->reversed)
            {
              if (loop_dump_stream)
                fprintf (loop_dump_stream,