diff options
author | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-01 01:04:01 +0000 |
---|---|---|
committer | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-01 01:04:01 +0000 |
commit | d1908618359a3e38ad401a73eb88aed1a2531b67 (patch) | |
tree | 168553bb855f69a9560df11aa4e6f6a692c8b648 /gcc/unroll.c | |
parent | a7eee06cf313da738ab12ce8481d02191cc9b913 (diff) | |
download | ppe42-gcc-d1908618359a3e38ad401a73eb88aed1a2531b67.tar.gz ppe42-gcc-d1908618359a3e38ad401a73eb88aed1a2531b67.zip |
* loop.c (check_insn_for_bivs): Use ivs->n_regs to check array bounds.
(find_mem_givs, record_biv, maybe_eliminate_biv): Likewise.
(record_initial): Likewise.
* unroll.c (copy_loop_body, loop_iterations): Likewise.
(remap_split_bivs): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38584 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r-- | gcc/unroll.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c index 4597343fc3d..b22d01f7a86 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -1912,7 +1912,7 @@ copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration, for the biv was stored in the biv's first struct induction entry by find_splittable_regs. */ - if (regno < max_reg_before_loop + if (regno < ivs->n_regs && REG_IV_TYPE (ivs, regno) == BASIC_INDUCT) { giv_src_reg = REG_IV_CLASS (ivs, regno)->biv->src_reg; @@ -3591,10 +3591,7 @@ loop_iterations (loop) } else if (REG_IV_TYPE (ivs, REGNO (iteration_var)) == BASIC_INDUCT) { - /* When reg_iv_type / reg_iv_info is resized for biv increments - that are turned into givs, reg_biv_class is not resized. - So check here that we don't make an out-of-bounds access. */ - if (REGNO (iteration_var) >= max_reg_before_loop) + if (REGNO (iteration_var) >= ivs->n_regs) abort (); /* Grab initial value, only useful if it is a constant. */ @@ -3609,7 +3606,7 @@ loop_iterations (loop) struct induction *v = REG_IV_INFO (ivs, REGNO (iteration_var)); rtx biv_initial_value; - if (REGNO (v->src_reg) >= max_reg_before_loop) + if (REGNO (v->src_reg) >= ivs->n_regs) abort (); bl = REG_IV_CLASS (ivs, REGNO (v->src_reg)); @@ -4012,7 +4009,7 @@ remap_split_bivs (loop, x) /* If non-reduced/final-value givs were split, then this would also have to remap those givs also. */ #endif - if (REGNO (x) < max_reg_before_loop + if (REGNO (x) < ivs->n_regs && REG_IV_TYPE (ivs, REGNO (x)) == BASIC_INDUCT) return REG_IV_CLASS (ivs, REGNO (x))->biv->src_reg; break; |