This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
cse infinite loop bugfix
- To: gcc-patches at gcc dot gnu dot org
- Subject: cse infinite loop bugfix
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 01 Aug 1999 23:54:55 -0600
- Reply-To: law at cygnus dot com
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);
}