From: Jim Wilson Date: Fri, 19 Jun 1998 18:54:44 +0000 (+0000) Subject: Fix hpux loop unrolling bug reported by Tim Prince. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e7ca3a1bd935133caa153c9c58c884641604959;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee5700f5df5..73465c726d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +1998-06-19 Jim Wilson + + * 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 * config/fp-bit.c (INLINE): Only define if not already defined. diff --git a/gcc/loop.h b/gcc/loop.h index 8a92a321185..25c16f0d89b 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 46dc7ac4499..e3c43ff9e46 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.