summaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-01-25 21:00:42 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-01-25 21:00:42 +0000
commit6d9a3d97f37078da6d9037e2b93204d1782a8f46 (patch)
tree63f5fda08d9629db3f1295efbbe79e27da9aad2a /gcc/recog.c
parent1b524264848bb62af26c24a64110e599bd12d895 (diff)
downloadgcc-6d9a3d97f37078da6d9037e2b93204d1782a8f46.tar.gz
* recog.c (validate_replace_rtx_1): Only perform substitutions
of arguments to commutative and comparison operators once. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17482 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index a2d2489357a..ef8d7626e3f 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -510,14 +510,19 @@ validate_replace_rtx_1 (loc, from, to, object)
break;
}
- fmt = GET_RTX_FORMAT (code);
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ /* For commutative or comparison operations we've already performed
+ replacements. Don't try to perform them again. */
+ if (GET_RTX_CLASS (code) != '<' && GET_RTX_CLASS (code) != 'c')
{
- if (fmt[i] == 'e')
- validate_replace_rtx_1 (&XEXP (x, i), from, to, object);
- else if (fmt[i] == 'E')
- for (j = XVECLEN (x, i) - 1; j >= 0; j--)
- validate_replace_rtx_1 (&XVECEXP (x, i, j), from, to, object);
+ fmt = GET_RTX_FORMAT (code);
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e')
+ validate_replace_rtx_1 (&XEXP (x, i), from, to, object);
+ else if (fmt[i] == 'E')
+ for (j = XVECLEN (x, i) - 1; j >= 0; j--)
+ validate_replace_rtx_1 (&XVECEXP (x, i, j), from, to, object);
+ }
}
}