This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
yet more genrecog checks
- To: gcc-patches at gcc dot gnu dot org
- Subject: yet more genrecog checks
- From: Richard Henderson <rth at cygnus dot com>
- Date: Thu, 14 Oct 1999 03:00:17 -0700
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;