From 3c37d7ad7198395e2493e849dfb402b61ce7b0c9 Mon Sep 17 00:00:00 2001
From: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Sat, 10 Apr 1999 22:16:29 +0000
Subject: [PATCH]         * recog.c (constrain_operands): Ignore unary
 operators when         matching operands.  Recognize '5'..'9' as well.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26342 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog |  5 +++++
 gcc/recog.c   | 22 +++++++++++++++-------
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 539923904686..6eed4a05fb67 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Sat Apr 10 22:12:12 1999  Jan Hubicka <hubicka@freesoft.cz>
+  
+	* recog.c (constrain_operands): Ignore unary operators when
+	matching operands.  Recognize '5'..'9' as well.
+
 Sat Apr 10 21:53:02 1999  Philipp Thomas  (kthomas@gwdg.de)
 			  Richard Henderson  <rth@cygnus.com>
 
diff --git a/gcc/recog.c b/gcc/recog.c
index 6bceae85a9e7..94e7abbffff5 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;
-- 
GitLab