loop.c (strength_reduce): Sink final_value when not eliminating a biv.
authorRichard Henderson <rth@redhat.com>
Fri, 8 Feb 2002 03:36:35 +0000 (19:36 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 8 Feb 2002 03:36:35 +0000 (19:36 -0800)
        * loop.c (strength_reduce): Sink final_value when not
        eliminating a biv.

From-SVN: r49606

gcc/ChangeLog
gcc/loop.c

index 019a5eccf63692a7dec112d7b4a73462b63232c2..23bde4ae480d56eea2780746b73f46f10e73d390 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-07  Richard Henderson  <rth@redhat.com>
+
+       * loop.c (strength_reduce): Sink final_value when not
+       eliminating a biv.
+
 2002-02-07  David O'Brien  <obrien@FreeBSD.org>
 
        * config/sparc/freebsd.h: Fix mismatched spec {.
index 5c92ec37cf2b8b66427fe883ee9886bafc214bfe..f675a87f0debcbc19be4262b25c6553dcc3e465f 100644 (file)
@@ -5143,6 +5143,11 @@ strength_reduce (loop, flags)
            fprintf (loop_dump_stream, "Reg %d: biv eliminated\n",
                     bl->regno);
        }
+      /* See above note wrt final_value.  But since we couldn't eliminate
+        the biv, we must set the value after the loop instead of before.  */
+      else if (bl->final_value && ! bl->reversed)
+       loop_insn_sink (loop, gen_move_insn (bl->biv->dest_reg,
+                                            bl->final_value));
     }
 
   /* Go through all the instructions in the loop, making all the