Loop clean up fixes

Clinton Popetz cpopetz@cygnus.com
Wed Jan 19 09:45:00 GMT 2000


Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:

> At 12:25 19.01.00 , Michael Hayes wrote:
> 
> >I've committed the following patch to fix the thinkos I introduced
> >with my changes to the loop optimizer.  Sorry folks.  This should fix
> >the ppc bootstrap problems.  Note that this is an interim solution and
> >will be superceded by my next hack at loop.c which I'm currently
> >testing for submission.
> >
> >
> >2000-01-20  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
> >
> >         * loop.c (current_loop_info): Renamed from loop_info_data
> >         and changed to a pointer.
> >         (loop_optimize): Allocate loop_info structure for each loop
> >         and initialise to zero.
> >         (scan_loop): Set current_loop_info.
> >
> >         * unroll.c (loop_iterations): Don't abort if REG_USERVAR_P set
> >         on iteration_var.
> 
> This makes the bootstrap fail again at the same spot as before. Now I have 
> this status:
> - Alexandre's patch + Clinton's unroll.c patch: bootstrap OK, no testsuite 
> regressions
> - Alexandre's patch + your unroll.c patch: bootstrap OK, but a few 
> regressions in the testsuite

What are the specific regressions?  Any differences between these two
patches should indicate that REG_USERVAR_P isn't set for a new register
created before loop_iterations, which needs to be investigated.

> - current CVS: bootstrap FAIL

This was a think-o in Michael's patch.  We need to allocate the loop
info struct for all the loops before scanning any of them, since inner
loops need the outer loops' info.

Does this fix your bootstrap?

				-Clint

Index: loop.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/loop.c,v
retrieving revision 1.220
diff -c -2 -p -r1.220 loop.c
*** loop.c	2000/01/19 11:19:20	1.220
--- loop.c	2000/01/19 17:26:53
*************** loop_optimize (f, dumpfile, unroll_p, bc
*** 511,517 ****
    indirect_jump_in_function = indirect_jump_in_function_p (f);
  
!   /* Now scan the loops, last ones first, since this means inner ones are done
!      before outer ones.  */
!   for (i = max_loop_num - 1; i >= 0; i--)
      {
        struct loop *loop = &loops->array[i];
--- 511,516 ----
    indirect_jump_in_function = indirect_jump_in_function_p (f);
  
!   /* Allocate loop structure for each loop, and initialize to zero.  */
!   for (i= 0; i < max_loop_num; i++)
      {
        struct loop *loop = &loops->array[i];
*************** loop_optimize (f, dumpfile, unroll_p, bc
*** 519,526 ****
        loop->info = (struct loop_info *) alloca (sizeof (struct loop_info));
        memset (loop->info, 0, sizeof (struct loop_info));
        
        if (! loop->invalid && loop->end)
  	scan_loop (loop, unroll_p, bct_p);
!     }
  
    /* Replicate the BLOCKs.  */
--- 518,531 ----
        loop->info = (struct loop_info *) alloca (sizeof (struct loop_info));
        memset (loop->info, 0, sizeof (struct loop_info));
+     }
        
+   /* Now scan the loops, last ones first, since this means inner ones are done
+      before outer ones.  */
+   for (i = max_loop_num - 1; i >= 0; i--)
+     {
+       struct loop *loop = &loops->array[i];
        if (! loop->invalid && loop->end)
  	scan_loop (loop, unroll_p, bct_p);
!     }  
  
    /* Replicate the BLOCKs.  */



More information about the Gcc-patches mailing list