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]

cse infinite loop bugfix



Opps.  Hit the send key too soon.

	* cse.c (cse_insn): Fix loop which deletes insns after a jump
	that has become an unconditional jump.

Index: cse.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cse.c,v
retrieving revision 1.72.4.1
diff -c -3 -p -r1.72.4.1 cse.c
*** cse.c	1999/07/13 17:03:22	1.72.4.1
--- cse.c	1999/08/02 05:49:30
*************** cse_insn (insn, libcall_insn)
*** 7483,7491 ****
  		 && GET_CODE (NEXT_INSN (p)) != BARRIER
  		 && GET_CODE (NEXT_INSN (p)) != CODE_LABEL)
  	    {
  	      if (GET_CODE (NEXT_INSN (p)) != NOTE
  		  || NOTE_LINE_NUMBER (NEXT_INSN (p)) == NOTE_INSN_DELETED)
! 		delete_insn (NEXT_INSN (p));
  	      else
  		p = NEXT_INSN (p);
  	    }
--- 7483,7494 ----
  		 && GET_CODE (NEXT_INSN (p)) != BARRIER
  		 && GET_CODE (NEXT_INSN (p)) != CODE_LABEL)
  	    {
+ 	      /* Note, we must update P with the return value from
+ 		 delete_insn, otherwise we could get an infinite loop
+ 		 if NEXT_INSN (p) had INSN_DELETED_P set.  */
  	      if (GET_CODE (NEXT_INSN (p)) != NOTE
  		  || NOTE_LINE_NUMBER (NEXT_INSN (p)) == NOTE_INSN_DELETED)
! 		p = delete_insn (NEXT_INSN (p));
  	      else
  		p = NEXT_INSN (p);
  	    }




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