aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@freesoft.cz>1999-04-11 00:16:29 +0200
committerRichard Henderson <rth@gcc.gnu.org>1999-04-10 15:16:29 -0700
commit62674ffe2b69f8d8550e718c478621500ff6effb (patch)
tree0d11b9b740ce0204ceafaeff59828f8f5e19b8fd /gcc/recog.c
parent83f4345f444119d37513fbb4fcb33daf1a8478f0 (diff)
downloadgcc-62674ffe2b69f8d8550e718c478621500ff6effb.zip
gcc-62674ffe2b69f8d8550e718c478621500ff6effb.tar.gz
gcc-62674ffe2b69f8d8550e718c478621500ff6effb.tar.bz2
recog.c (constrain_operands): Ignore unary operators when matching operands.
* recog.c (constrain_operands): Ignore unary operators when matching operands. Recognize '5'..'9' as well. From-SVN: r26342
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 6bceae8..94e7abb 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2303,11 +2303,8 @@ constrain_operands (strict)
earlyclobber[opno] = 1;
break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
/* This operand must be the same as a previous one.
This kind of constraint is used for instructions such
as add when they take only two operands.
@@ -2319,8 +2316,19 @@ constrain_operands (strict)
if (strict < 0)
val = 1;
else
- val = operands_match_p (recog_operand[c - '0'],
- recog_operand[opno]);
+ {
+ rtx op1 = recog_operand[c - '0'];
+ rtx op2 = recog_operand[opno];
+
+ /* A unary operator may be accepted by the predicate,
+ but it is irrelevant for matching constraints. */
+ if (GET_RTX_CLASS (GET_CODE (op1)) == '1')
+ op1 = XEXP (op1, 0);
+ if (GET_RTX_CLASS (GET_CODE (op2)) == '1')
+ op2 = XEXP (op2, 0);
+
+ val = operands_match_p (op1, op2);
+ }
matching_operands[opno] = c - '0';
matching_operands[c - '0'] = opno;