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: optimization/870: Internal error: Segmentation fault.


On Thu, Nov 23, 2000 at 01:33:44AM -0000, igor@txc.com wrote:
> GNU C version 2.97 20001122 (experimental) (i386-pc-linux-gnu)
> galois.c: In function `lirecoset':
> galois.c:484: Internal error: Segmentation fault.
> Please submit a full bug report.

If loop_iterations fails with "Not basic or general induction var",
we can wind up dereferencing a null pointer in precondition_loop_p.

Fixed thus.


r~


        * unroll.c (precondition_loop_p): Fail if no iteration
        variable found.

Index: unroll.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/unroll.c,v
retrieving revision 1.123
diff -c -p -d -r1.123 unroll.c
*** unroll.c	2001/01/13 21:54:10	1.123
--- unroll.c	2001/01/16 11:14:04
*************** precondition_loop_p (loop, initial_value
*** 1381,1387 ****
        return 1;
      }
  
!   if (loop_info->initial_value == 0)
      {
        if (loop_dump_stream)
  	fprintf (loop_dump_stream,
--- 1381,1394 ----
        return 1;
      }
  
!   if (loop_info->iteration_var == 0)
!     {
!       if (loop_dump_stream)
! 	fprintf (loop_dump_stream,
! 		 "Preconditioning: Could not find iteration variable.\n");
!       return 0;
!     }
!   else if (loop_info->initial_value == 0)
      {
        if (loop_dump_stream)
  	fprintf (loop_dump_stream,

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