summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorcpopetz <cpopetz@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-14 00:41:31 +0000
committercpopetz <cpopetz@138bc75d-0d04-0410-961f-82ee72b054a4>2000-04-14 00:41:31 +0000
commit5262c25318f66b459190a127369c64fe9da348c1 (patch)
treea51aa7adf842d0029fca90fbf81d83bd646c81b0 /gcc/emit-rtl.c
parent16e8b82c58f0c8f6ec13902666167f3b9e881c8e (diff)
downloadgcc-5262c25318f66b459190a127369c64fe9da348c1.tar.gz
* emit-rtl.c (try_split): Avoid infinite loop if the split
results in a sequence that contains the original insn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33143 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index e697d55c455..8fd559ca928 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--)