yet more genrecog checks

Richard Henderson rth@cygnus.com
Thu Oct 14 03:00:00 GMT 1999


Added a check for SET_DEST operands having output reload
constraints.  You wouldn't believe how many this turned up...


r~

        * genrecog.c (validate_pattern): Typo last change.  Verify
        that output operands have output reloads.

Index: genrecog.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/genrecog.c,v
retrieving revision 1.63
diff -c -p -d -r1.63 genrecog.c
*** genrecog.c	1999/10/14 09:37:31	1.63
--- genrecog.c	1999/10/14 09:56:48
*************** validate_pattern (pattern, insn, set_des
*** 525,536 ****
  	    && pred_name[0] != '\0'
  	    && allows_non_const
  	    && ! special_mode_pred
! 	    && strstr (c_test, "operands") != NULL
  	    && GET_CODE (insn) == DEFINE_INSN)
  	  {
  	    message_with_line (pattern_lineno,
  			       "warning: operand %d missing mode?",
  			       XINT (pattern, 0));
  	  }
  
  	return;
--- 525,549 ----
  	    && pred_name[0] != '\0'
  	    && allows_non_const
  	    && ! special_mode_pred
! 	    && strstr (c_test, "operands") == NULL
  	    && GET_CODE (insn) == DEFINE_INSN)
  	  {
  	    message_with_line (pattern_lineno,
  			       "warning: operand %d missing mode?",
  			       XINT (pattern, 0));
+ 	  }
+ 
+ 	/* A MATCH_OPERAND that is a SET should have an output reload.  */
+ 	if (set_dest
+ 	    && code == MATCH_OPERAND
+ 	    && XSTR (pattern, 2)[0] != '\0'
+ 	    && XSTR (pattern, 2)[0] != '='
+ 	    && XSTR (pattern, 2)[0] != '+')
+ 	  {
+ 	    message_with_line (pattern_lineno,
+ 			       "operand %d missing output reload", 
+ 			       XINT (pattern, 0));
+ 	    error_count++;
  	  }
  
  	return;


More information about the Gcc-patches mailing list