Fix consec_sets_giv bug.

From-SVN: r37619
This commit is contained in:
Bernd Schmidt 2000-11-21 18:24:42 +00:00 committed by Bernd Schmidt
parent ce79b0cace
commit 847dde9555
2 changed files with 11 additions and 2 deletions

View File

@ -1,5 +1,9 @@
2000-11-21 Bernd Schmidt <bernds@redhat.co.uk> 2000-11-21 Bernd Schmidt <bernds@redhat.co.uk>
* loop.c (consec_sets_giv): If the reg we're examining is anything
but UNKNOWN_INDUCT, do nothing.
Reset the reg's type to UNKNOWN_INDUCT before returning.
Mostly from Vladimir Makarov (vmakarov@redhat.com) Mostly from Vladimir Makarov (vmakarov@redhat.com)
* ia64.md (attr itanium_class): Define insn types as described in * ia64.md (attr itanium_class): Define insn types as described in
Itanium docs. Itanium docs.

View File

@ -6203,8 +6203,12 @@ consec_sets_giv (loop, first_benefit, p, src_reg, dest_reg,
general_induction_var below, so we can allocate it on our stack. general_induction_var below, so we can allocate it on our stack.
If this is a giv, our caller will replace the induct var entry with If this is a giv, our caller will replace the induct var entry with
a new induction structure. */ a new induction structure. */
struct induction *v struct induction *v;
= (struct induction *) alloca (sizeof (struct induction));
if (REG_IV_TYPE (ivs, REGNO (dest_reg)) != UNKNOWN_INDUCT)
return 0;
v = (struct induction *) alloca (sizeof (struct induction));
v->src_reg = src_reg; v->src_reg = src_reg;
v->mult_val = *mult_val; v->mult_val = *mult_val;
v->add_val = *add_val; v->add_val = *add_val;
@ -6265,6 +6269,7 @@ consec_sets_giv (loop, first_benefit, p, src_reg, dest_reg,
} }
} }
REG_IV_TYPE (ivs, REGNO (dest_reg)) = UNKNOWN_INDUCT;
*last_consec_insn = p; *last_consec_insn = p;
return v->benefit; return v->benefit;
} }