aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-06-19 18:54:44 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-06-19 11:54:44 -0700
commit7e7ca3a1bd935133caa153c9c58c884641604959 (patch)
tree87e0bca439aa9c3eede052c05bebd84e9756863d
parent643a7267dfd1aae8deee17a411747a3699ec2691 (diff)
downloadgcc-7e7ca3a1bd935133caa153c9c58c884641604959.zip
gcc-7e7ca3a1bd935133caa153c9c58c884641604959.tar.gz
gcc-7e7ca3a1bd935133caa153c9c58c884641604959.tar.bz2
Fix hpux loop unrolling bug reported by Tim Prince.
* loop.h (struct induction): Clarify comment for unrolled field. * unroll.c (find_splittable_givs): Move set of unrolled field after address validity check. From-SVN: r20598
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/loop.h4
-rw-r--r--gcc/unroll.c5
3 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ee5700f..73465c7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+1998-06-19 Jim Wilson <wilson@cygnus.com>
+
+ * loop.h (struct induction): Clarify comment for unrolled field.
+ * unroll.c (find_splittable_givs): Move set of unrolled field
+ after address validity check.
+
Fri Jun 19 18:38:04 1998 Michael Meissner <meissner@cygnus.com>
* config/fp-bit.c (INLINE): Only define if not already defined.
diff --git a/gcc/loop.h b/gcc/loop.h
index 8a92a32..25c16f0 100644
--- a/gcc/loop.h
+++ b/gcc/loop.h
@@ -92,8 +92,8 @@ struct induction
would probably lose. */
unsigned auto_inc_opt : 1; /* 1 if this giv had its increment output next
to it to try to form an auto-inc address. */
- unsigned unrolled : 1; /* 1 if new register has been allocated in
- unrolled loop. */
+ unsigned unrolled : 1; /* 1 if new register has been allocated and
+ initialized in unrolled loop. */
unsigned shared : 1;
int lifetime; /* Length of life of this giv */
int times_used; /* # times this giv is used. */
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 46dc7ac..e3c43ff 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -2907,7 +2907,6 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
rtx tem = gen_reg_rtx (v->mode);
record_base_value (REGNO (tem), v->add_val, 0);
- v->unrolled = 1;
/* If the address giv has a constant in its new_reg value,
then this constant can be pulled out and put in value,
@@ -2960,6 +2959,10 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
continue;
}
+ /* We set this after the address check, to guarantee that
+ the register will be initialized. */
+ v->unrolled = 1;
+
/* To initialize the new register, just move the value of
new_reg into it. This is not guaranteed to give a valid
instruction on machines with complex addressing modes.