From: Bernd Schmidt Date: Thu, 30 Nov 2000 11:59:43 +0000 (+0000) Subject: Backport a change to the 2.95 branch X-Git-Tag: prereleases/gcc-2.95.3-test1~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=557d61401995934a806268dbd5e850ef1ed992f8;p=thirdparty%2Fgcc.git Backport a change to the 2.95 branch From-SVN: r37878 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6bfed8719ff6..9c60312f0f8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2000-11-30 Bernd Schmidt + Thu Apr 13 19:39:56 2000 Clinton Popetz + * 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 * combine.c (combine_simplify_rtx): Don't make shared rtl. (simplify_logical): Likewise. diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 36b030ae7b6b..222a1a937f09 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -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--)