loop.c (strength_reduce): Sink final_value when not eliminating a biv.

* loop.c (strength_reduce): Sink final_value when not
        eliminating a biv.

From-SVN: r49606
This commit is contained in:
Richard Henderson 2002-02-07 19:36:35 -08:00 committed by Richard Henderson
parent 9dd7fc76c7
commit 5c7f5a5f55
2 changed files with 10 additions and 0 deletions

View 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> 2002-02-07 David O'Brien <obrien@FreeBSD.org>
* config/sparc/freebsd.h: Fix mismatched spec {. * config/sparc/freebsd.h: Fix mismatched spec {.

View File

@ -5143,6 +5143,11 @@ strength_reduce (loop, flags)
fprintf (loop_dump_stream, "Reg %d: biv eliminated\n", fprintf (loop_dump_stream, "Reg %d: biv eliminated\n",
bl->regno); 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 /* Go through all the instructions in the loop, making all the