summaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-18 17:47:53 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-18 17:47:53 +0000
commite30880eb6320d4ad55398378184e84173d055ee2 (patch)
tree3c2ad71841be61161eb89250994d793b705891d1 /gcc/loop.c
parent3c4608dc9a7017bf1e814e76410ccef3cb563965 (diff)
downloadgcc-e30880eb6320d4ad55398378184e84173d055ee2.tar.gz
* loop.c (strength_reduce): For derived givs, replace the
giv this was derived from with its new_reg. (recombine_givs): Don't set new_reg for derived giv. And don't print it, print SUM instead. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25289 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 932a72549bf..a5ea970b95c 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -4682,10 +4682,21 @@ strength_reduce (scan_start, end, loop_top, insn_count,
{
int auto_inc_opt = 0;
- v->new_reg = gen_reg_rtx (v->mode);
+ /* If the code for derived givs immediately below has already
+ allocated a new_reg, we must keep it. */
+ if (! v->new_reg)
+ v->new_reg = gen_reg_rtx (v->mode);
if (v->derived_from)
{
+ struct induction *d = v->derived_from;
+
+ /* In case d->dest_reg is not replaceable, we have
+ to replace it in v->insn now. */
+ if (! d->new_reg)
+ d->new_reg = gen_reg_rtx (d->mode);
+ PATTERN (v->insn)
+ = replace_rtx (PATTERN (v->insn), d->dest_reg, d->new_reg);
PATTERN (v->insn)
= replace_rtx (PATTERN (v->insn), v->dest_reg, v->new_reg);
if (bl->biv_count != 1)
@@ -7359,11 +7370,9 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
&& GET_CODE (XEXP (sum, 1)) == CONST_INT)
|| ! unroll_p)
&& validate_change (v->insn, &PATTERN (v->insn),
- gen_rtx_SET (GET_MODE (v->dest_reg),
- v->dest_reg, sum), 0))
+ gen_rtx_SET (VOIDmode, v->dest_reg, sum), 0))
{
v->derived_from = last_giv;
- v->new_reg = v->dest_reg;
life_end = stats[i].end_luid;
if (loop_dump_stream)
@@ -7371,7 +7380,7 @@ recombine_givs (bl, loop_start, loop_end, unroll_p)
fprintf (loop_dump_stream,
"giv at %d derived from %d as ",
INSN_UID (v->insn), INSN_UID (last_giv->insn));
- print_rtl (loop_dump_stream, v->new_reg);
+ print_rtl (loop_dump_stream, sum);
putc ('\n', loop_dump_stream);
}
}