This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bootstrap comparison failure on i686-linux

>>>>> Franz Sirl writes:

 > I have similar problems on powerpc-linux-gnu and for me the differences start 
 > in the loop dump. After realizing that I checked out the recent loop patches 
 > from Michael Hayes and I think I found a difference against the original 
 > code, realloced memory is not cleared anymore. VARRAY_GROW handled that 
 > automatically before. The appended patch fixes that, but I don't know yet if 
 > it really fixes the comparison failure, bootstrap is still running. You might 
 > wanna try the patch nevertheless though. I'll check it in under the "obvious 
 > fix rule" if it fixes my comparison failure.

Uninitialized memory might explain why I can't reproduce it reliable.
I just tried another bootstrap (but with --enable-languages=c) and it
was successfull.

 > Franz.

 > 	* loop.c (load_mems_and_recount_loop_regs_set): Clear memory added by
 > 	realloc.

 > Index: loop.c
 > ===================================================================
 > RCS file: /cvs/gcc/gcc/gcc/loop.c,v
 > retrieving revision 1.314
 > diff -u -p -r1.314 loop.c
 > --- loop.c	2001/01/06 03:24:57	1.314
 > +++ loop.c	2001/01/06 19:33:46
 > @@ -8724,9 +8724,11 @@ load_mems_and_recount_loop_regs_set (loo
 >  	  /* Grow the array.  */
regs-> array = (struct loop_reg *)
 >  	    xrealloc (regs->array, regs->size * sizeof (*regs->array));
 > +	  for (i = old_nregs; i < regs->num; i++)
 > +	    memset (&regs->array[i], 0, sizeof (*regs->array));
 >  	}
 > -      for (i = 0; i < regs->num; i++)
 > +      for (i = 0; i < old_nregs; i++)
 >  	{
regs-> array[i].set_in_loop = 0;
regs-> array[i].may_not_optimize = 0;

Instead of your patch, why can't we clear all members in the second
loop?  The second loop doesn't clear n_times_set and moved-once -
clearing them also should be the better way to fix it.  Or should
those members not get reset?

 Andreas Jaeger
  SuSE Labs

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]