From: J"orn Rennecke Date: Thu, 18 Feb 1999 17:47:53 +0000 (+0000) Subject: loop.c (strength_reduce): For derived givs, replace the giv this was derived from... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=743f9f5dfdca8dfa597125b06edddfb61a968d06;p=gcc.git loop.c (strength_reduce): For derived givs, replace the giv this was derived from with its new_reg. * 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. From-SVN: r25289 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4e3b4f8af3..bdc71f9fb82 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Fri Feb 19 01:45:06 1999 J"orn Rennecke + + * 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. + Thu Feb 18 15:52:49 1999 Jim Wilson * m68kelf.h (ASM_RETURN_CASE_JUMP): Add 5200 support. 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); } }