]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport a change to the 2.95 branch
authorBernd Schmidt <bernds@redhat.co.uk>
Thu, 30 Nov 2000 11:59:43 +0000 (11:59 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Thu, 30 Nov 2000 11:59:43 +0000 (11:59 +0000)
From-SVN: r37878

gcc/ChangeLog
gcc/emit-rtl.c

index 6bfed8719ff6f624870edf4f7bdd50a058a5c025..9c60312f0f8c33594c61a9ad46d3551e4cfc38cb 100644 (file)
@@ -1,5 +1,9 @@
 2000-11-30  Bernd Schmidt  <bernds@redhat.co.uk>
 
+       Thu Apr 13 19:39:56 2000  Clinton Popetz  <cpopetz@cygnus.com>
+       * emit-rtl.c (try_split): Avoid infinite loop if the split
+       results in a sequence that contains the original insn.
+
        1999-12-14  Bernd Schmidt  <bernds@cygnus.co.uk>
        * combine.c (combine_simplify_rtx): Don't make shared rtl.
        (simplify_logical): Likewise.
index 36b030ae7b6b42fbba568fb496bc3fabca47dfad..222a1a937f096b24f1a6a5f650ed69957d7c65b1 100644 (file)
@@ -2359,10 +2359,18 @@ try_split (pat, trial, last)
         it, in turn, will be split (SFmode on the 29k is an example).  */
       if (GET_CODE (seq) == SEQUENCE)
        {
+         int i;
+
+         /* Avoid infinite loop if any insn of the result matches 
+            the original pattern.  */
+         for (i = 0; i < XVECLEN (seq, 0); i++)
+           if (GET_CODE (XVECEXP (seq, 0, i)) == INSN 
+               && rtx_equal_p (PATTERN (XVECEXP (seq, 0, i)), pat))
+             return trial;
+
          /* If we are splitting a JUMP_INSN, look for the JUMP_INSN in
             SEQ and copy our JUMP_LABEL to it.  If JUMP_LABEL is non-zero,
             increment the usage count so we don't delete the label.  */
-         int i;
 
          if (GET_CODE (trial) == JUMP_INSN)
            for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)