diff options
author | Alasdair Baird <alasdair@wildcat.demon.co.uk> | 1998-01-25 21:00:42 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-01-25 14:00:42 -0700 |
commit | f745c7a273698b7201ec407c1add3a1cf9ea059f (patch) | |
tree | 63f5fda08d9629db3f1295efbbe79e27da9aad2a /gcc/recog.c | |
parent | 6a093053a3fabfd66e58debfe36783c0b8fa444a (diff) | |
download | gcc-f745c7a273698b7201ec407c1add3a1cf9ea059f.tar.gz |
recog.c (validate_replace_rtx_1): Only perform substitutions of arguments to commutative and comparison operators...
* recog.c (validate_replace_rtx_1): Only perform substitutions
of arguments to commutative and comparison operators once.
From-SVN: r17482
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 19 |
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); + } } } |