This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: hpux20 pointer optimization bug
- To: law at cygnus dot com
- Subject: Re: hpux20 pointer optimization bug
- From: Jim Wilson <wilson at cygnus dot com>
- Date: Fri, 19 Jun 1998 18:55:09 -0700
- cc: tprince at cat dot e-mail dot com, egcs-patches at cygnus dot com, tprince at computer dot org
I have reproduced the bug, and verified that my patch fixes it. I updated
the comment in loop.h, and checked in my patch.
Jim
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.
Index: loop.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/loop.h,v
retrieving revision 1.6
diff -p -r1.6 loop.h
*** loop.h 1998/04/03 16:36:09 1.6
--- loop.h 1998/06/20 01:33:23
*************** struct induction
*** 92,99 ****
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 shared : 1;
int lifetime; /* Length of life of this giv */
int times_used; /* # times this giv is used. */
--- 92,99 ----
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 and
! initialized in unrolled loop. */
unsigned shared : 1;
int lifetime; /* Length of life of this giv */
int times_used; /* # times this giv is used. */
Index: unroll.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/unroll.c,v
retrieving revision 1.24
diff -p -r1.24 unroll.c
*** unroll.c 1998/06/10 09:49:30 1.24
--- unroll.c 1998/06/20 01:33:23
*************** find_splittable_givs (bl, unroll_type, l
*** 2907,2913 ****
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,
--- 2907,2912 ----
*************** find_splittable_givs (bl, unroll_type, l
*** 2960,2965 ****
--- 2959,2968 ----
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.