This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Recog fix to allow unary operators in operands



Hi
The commend in recog.c says:
 /* A unary operator may be accepted by the predicate, but it
    is irrelevant for matching constraints.  */
This seems to be true except for the "0" and similar constraints.
In this cases operands_match_p is called for recog_operands directly
and fails in such cases.

My life can be much easier if it don't do so. So here is a patch that
attempts to avoid this behaviour.
I am not sure if such change don't belongs to operands_match_p, because
this function is called by reload as well and maybe we would like to have
consistent behaviour in both.

Thu Apr  8 23:16:40 CEST 1999 Jan Hubicka <hubicka@freesoft.cz>

	* recog.c (constrain_operands): Ignore unary operators when
	matching operands.

*** recog.c.old	Thu Apr  8 22:29:07 1999
--- recog.c	Thu Apr  8 23:02:10 1999
*************** constrain_operands (strict)
*** 2319,2326 ****
  		if (strict < 0)
  		  val = 1;
  		else
! 		  val = operands_match_p (recog_operand[c - '0'],
! 					  recog_operand[opno]);
  
  		matching_operands[opno] = c - '0';
  		matching_operands[c - '0'] = opno;
--- 2319,2336 ----
  		if (strict < 0)
  		  val = 1;
  		else
! 		  {
! 		    rtx op1 = recog_operand[c - '0'], 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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]