]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cse.c (cse_insn): Fix loop which deletes insns after a jump that has become an uncond...
authorJeffrey A Law <law@cygnus.com>
Mon, 2 Aug 1999 05:51:32 +0000 (05:51 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 2 Aug 1999 05:51:32 +0000 (23:51 -0600)
        * cse.c (cse_insn): Fix loop which deletes insns after a jump
        that has become an unconditional jump.

From-SVN: r28387

gcc/ChangeLog
gcc/cse.c

index 358828434e658a8e4d31f62b54ba9669f56022a4..b437fb400739a77704ac3a7de126310a1c67e79b 100644 (file)
@@ -1,5 +1,8 @@
 Sun Aug  1 22:46:42 1999  Jeffrey A Law  (law@cygnus.com)
 
+       * cse.c (cse_insn): Fix loop which deletes insns after a jump
+       that has become an unconditional jump.
+
        * m68k.c (output_function_prologue): Fix typo in CPU32 case.
        (output_function_epilogue): Similarly.
 
index 605d18507539a0365cf10c0d0fa5212a26a1b29a..05875d8a861fbce1d63bcd1a7dfec110147ace0b 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -7483,9 +7483,12 @@ cse_insn (insn, libcall_insn)
                 && 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)
-               delete_insn (NEXT_INSN (p));
+               p = delete_insn (NEXT_INSN (p));
              else
                p = NEXT_INSN (p);
            }