patch applied to loop.c

Joern Rennecke amylaar@cygnus.co.uk
Wed Jun 9 14:10:00 GMT 1999


Reviewed by Jeffrey Law.

Wed Jun  9 19:44:26 1999  J"orn Rennecke <amylaar@cygnus.co.uk>

	* loop.c (loop_insn_first_p): Don't compare LUIDs when P
	is a note; use <= for the compare; advance P while it is
	a NOTE.

Index: loop.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/loop.c,v
retrieving revision 1.160
diff -p -r1.160 loop.c
*** loop.c	1999/06/04 01:32:21	1.160
--- loop.c	1999/06/09 18:44:49
*************** loop_insn_first_p (insn, reference)
*** 8199,8209 ****
        if (p == reference || ! q)
          return 1;
  
        if (INSN_UID (p) < max_uid_for_loop
! 	  && INSN_UID (q) < max_uid_for_loop)
! 	return INSN_LUID (p) < INSN_LUID (q);
  
!       if (INSN_UID (p) >= max_uid_for_loop)
  	p = NEXT_INSN (p);
        if (INSN_UID (q) >= max_uid_for_loop)
  	q = NEXT_INSN (q);
--- 8199,8214 ----
        if (p == reference || ! q)
          return 1;
  
+       /* Either of P or Q might be a NOTE.  Notes have the same LUID as the
+          previous insn, hence the <= comparison below does not work if
+ 	 P is a note.  */
        if (INSN_UID (p) < max_uid_for_loop
! 	  && INSN_UID (q) < max_uid_for_loop
! 	  && GET_CODE (p) != NOTE)
! 	return INSN_LUID (p) <= INSN_LUID (q);
  
!       if (INSN_UID (p) >= max_uid_for_loop
! 	  || GET_CODE (p) == NOTE)
  	p = NEXT_INSN (p);
        if (INSN_UID (q) >= max_uid_for_loop)
  	q = NEXT_INSN (q);


More information about the Gcc-patches mailing list