summaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1996-05-19 00:16:38 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1996-05-19 00:16:38 +0000
commitc5a80968566b89e3b4dbd25c97ff98d903271020 (patch)
tree8c58b1761dbddf008c6c7dc8474cf08000bb2111 /gcc/unroll.c
parent35cc3127cf0b384d86e3357052156ccf4106ea78 (diff)
downloadgcc-c5a80968566b89e3b4dbd25c97ff98d903271020.tar.gz
(copy_loop_body): When update split DEST_ADDR giv,
check to make sure it was split. (find_splittable_givs): Fix reversed test of verify_addresses result. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@12034 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index e5b1e0ecb9d..377f046a822 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -1606,10 +1606,15 @@ 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)
{
- int this_giv_inc = INTVAL (giv_inc);
+ int this_giv_inc;
+
+ /* If this DEST_ADDR giv was not split, then ignore it. */
+ if (*tv->location != tv->dest_reg)
+ continue;
/* Scale this_giv_inc if the multiplicative factors of
the two givs are different. */
+ this_giv_inc = INTVAL (giv_inc);
if (tv->mult_val != v->mult_val)
this_giv_inc = (this_giv_inc / INTVAL (v->mult_val)
* INTVAL (tv->mult_val));
@@ -2780,7 +2785,7 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
Try to validate both the first and the last
address resulting from loop unrolling, if
one fails, then can't do const elim here. */
- if (! verify_addresses (v, giv_inc, unroll_number))
+ if (verify_addresses (v, giv_inc, unroll_number))
{
/* Save the negative of the eliminated const, so
that we can calculate the dest_reg's increment