aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.co.uk>2000-11-21 18:24:42 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2000-11-21 18:24:42 +0000
commit847dde9555b9dc852d1de2678c99496b498446cc (patch)
tree0913464a1a9ecbc93c4ce65df7c7a2820085f4b4
parentce79b0cace170a63c38c41e35d1f44b54043ffb7 (diff)
downloadgcc-847dde9555b9dc852d1de2678c99496b498446cc.zip
gcc-847dde9555b9dc852d1de2678c99496b498446cc.tar.gz
gcc-847dde9555b9dc852d1de2678c99496b498446cc.tar.bz2
Fix consec_sets_giv bug.
From-SVN: r37619
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/loop.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d781a13..3ac3a3f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
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)
* ia64.md (attr itanium_class): Define insn types as described in
Itanium docs.
diff --git a/gcc/loop.c b/gcc/loop.c
index 267c469..a514d05 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -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.
If this is a giv, our caller will replace the induct var entry with
a new induction structure. */
- struct induction *v
- = (struct induction *) alloca (sizeof (struct induction));
+ struct induction *v;
+
+ 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->mult_val = *mult_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;
return v->benefit;
}