aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorClinton Popetz <cpopetz@cygnus.com>2000-04-14 00:41:31 +0000
committerClinton Popetz <cpopetz@gcc.gnu.org>2000-04-13 20:41:31 -0400
commit4b5e8abe18f9afc7a184e184182a609da1f819f0 (patch)
treea51aa7adf842d0029fca90fbf81d83bd646c81b0 /gcc
parent460f6b71942e7245fdc14eed44db51291ec281be (diff)
downloadgcc-4b5e8abe18f9afc7a184e184182a609da1f819f0.zip
gcc-4b5e8abe18f9afc7a184e184182a609da1f819f0.tar.gz
gcc-4b5e8abe18f9afc7a184e184182a609da1f819f0.tar.bz2
emit-rtl.c (try_split): Avoid infinite loop if the split results in a sequence that contains the...
* emit-rtl.c (try_split): Avoid infinite loop if the split results in a sequence that contains the original insn. From-SVN: r33143
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/emit-rtl.c10
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0b3925f..a356333 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2000-04-13 Andreas Jaeger <aj@suse.de>
* config/mips/mips.c (expand_block_move): Pass alignment
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index e697d55..8fd559c 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -2336,10 +2336,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--)