summaryrefslogtreecommitdiff
path: root/gcc/doloop.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-28 18:09:26 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-28 18:09:26 +0000
commit8f9ea7914d6b8880b080c4a6d5b2fa979f948e80 (patch)
treeac2618577cfde9967a56e67bf26ecd32a0196efc /gcc/doloop.c
parent10582df7cd4a4433bdda159bb13fb6f88853b31c (diff)
downloadgcc-8f9ea7914d6b8880b080c4a6d5b2fa979f948e80.tar.gz
* doloop.c (doloop_modify_runtime): Properly select induction
variable; skip late entry test if biv initializer created by loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47423 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doloop.c')
-rw-r--r--gcc/doloop.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/doloop.c b/gcc/doloop.c
index be232d63e6c..cf50d685096 100644
--- a/gcc/doloop.c
+++ b/gcc/doloop.c
@@ -621,11 +621,23 @@ doloop_modify_runtime (loop, iterations_max,
if (loop->scan_start)
{
+ rtx iteration_var = loop_info->iteration_var;
struct loop_ivs *ivs = LOOP_IVS (loop);
- struct iv_class *bl
- = REG_IV_CLASS (ivs, REGNO (loop_info->iteration_var));
+ struct iv_class *bl;
- if (INSN_LUID (bl->biv->insn) < INSN_LUID (loop->scan_start))
+ if (REG_IV_TYPE (ivs, REGNO (iteration_var)) == BASIC_INDUCT)
+ bl = REG_IV_CLASS (ivs, REGNO (iteration_var));
+ else if (REG_IV_TYPE (ivs, REGNO (iteration_var)) == GENERAL_INDUCT)
+ {
+ struct induction *v = REG_IV_INFO (ivs, REGNO (iteration_var));
+ bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
+ }
+ else
+ /* Iteration var must be an induction variable to get here. */
+ abort();
+
+ if (INSN_UID (bl->biv->insn) < max_uid_for_loop
+ && INSN_LUID (bl->biv->insn) < INSN_LUID (loop->scan_start))
{
if (loop_dump_stream)
fprintf (loop_dump_stream,