From: Alasdair Baird Date: Sun, 25 Jan 1998 21:00:42 +0000 (+0000) Subject: recog.c (validate_replace_rtx_1): Only perform substitutions of arguments to commutat... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f745c7a273698b7201ec407c1add3a1cf9ea059f;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4a5d98765f7..d0f76d280b1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Sun Jan 25 22:00:25 1998 Alasdair Baird + + * recog.c (validate_replace_rtx_1): Only perform substitutions + of arguments to commutative and comparison operators once. + Sun Jan 25 12:30:18 1998 Kaveh R. Ghazi * sparc.c (output_cbranch): Add default case in 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); + } } }