This is the mail archive of the gcc-patches@gcc.gnu.org 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: Loop clean up fixes



I wrote:

 > Now that's a puzzle since Alexandre's and my patches should be
 > functionally equivalent but his was not initialising the
 > used_count_register field.  I will check this out now.

Now that I've woken up, I've found the obvious bug.  I've built a
rs6000-ibm-aix cross compiler and it now doesn't die compiling nested
loops in insert_bct.  I've commited the following patch.

Michael.

Index: loop.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/loop.c,v
retrieving revision 1.220
retrieving revision 1.221
diff -c -3 -p -r1.220 -r1.221
*** loop.c	2000/01/19 11:19:20	1.220
--- loop.c	2000/01/19 20:10:00	1.221
*************** loop_optimize (f, dumpfile, unroll_p, bc
*** 510,524 ****
       this prevents low overhead loop instructions from being used.  */
    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];
  
        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);
      }
--- 510,530 ----
       this prevents low overhead loop instructions from being used.  */
    indirect_jump_in_function = indirect_jump_in_function_p (f);
  
!   /* Allocate and initialize auxiliary loop information.  */
    for (i = max_loop_num - 1; i >= 0; i--)
      {
        struct loop *loop = &loops->array[i];
  
        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);
      }


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