OSDN Git Service

(strength_reduce): Don't ignore a giv that depends on a
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Jul 1993 17:50:26 +0000 (17:50 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 28 Jul 1993 17:50:26 +0000 (17:50 +0000)
reversed biv.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5025 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/loop.c

index 1d1c03a..d51fff7 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,