diff options
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r-- | gcc/unroll.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c index 249099a..86c229d 100644 --- a/gcc/unroll.c +++ b/gcc/unroll.c @@ -1461,8 +1461,10 @@ copy_loop_body (copy_start, copy_end, map, exit_label, last_iteration, for (tv = bl->giv; tv; tv = tv->next_iv) if (tv->giv_type == DEST_ADDR && tv->same == v) { + /* Increment the giv by the amount that was calculated in + find_splittable_givs, and saved in add_val. */ tv->dest_reg = plus_constant (tv->dest_reg, - INTVAL (giv_inc)); + INTVAL (tv->add_val)); *tv->location = tv->dest_reg; if (last_iteration && unroll_type != UNROLL_COMPLETELY) @@ -2596,7 +2598,14 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment, addr_combined_regs[REGNO (v->new_reg)] = v; } } - + + /* Overwrite the old add_val, which is no longer needed, and + substitute the amount that the giv is incremented on each + iteration. We need to save this somewhere, so we know how + much to increment split DEST_ADDR giv's in copy_loop_body. */ + + v->add_val = giv_inc; + if (loop_dump_stream) fprintf (loop_dump_stream, "DEST_ADDR giv being split.\n"); } |