summaryrefslogtreecommitdiff
path: root/gcc/genoutput.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-08 15:00:34 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-08 15:00:34 +0000
commitcbb955b0d43c611d8d408f8d1b237385c906648f (patch)
treea0c23b6e97fff3605468cc753addf1d49c74ad81 /gcc/genoutput.c
parentd70ba424573058e6bcba5d31131ae0083e413269 (diff)
downloadgcc-cbb955b0d43c611d8d408f8d1b237385c906648f.tar.gz
2009-04-08 Paolo Bonzini <bonzini@gnu.org>
* genoutput.c (validate_optab_operands): New. (gen_insn, gen_expand): Call it. * genflags.c (gen_insn): Detect misused iterators. (main): Pass line_no to gen_insn, exit with status 1 on error. * genextract.c (line_no): Make global. (VEC_safe_set_locstr): Change assertion to error message. (main): Exit with status 1 on error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145746 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genoutput.c')
-rw-r--r--gcc/genoutput.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index 39fc590f01f..e651cb4d878 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -830,6 +830,22 @@ validate_insn_operands (struct data *d)
have_error = 1;
}
}
+
+static void
+validate_optab_operands (struct data *d)
+{
+ if (!d->name || d->name[0] == '\0' || d->name[0] == '*')
+ return;
+
+ /* Miscellaneous tests. */
+ if (strncmp (d->name, "cstore", 6) == 0
+ && d->name[strlen (d->name) - 1] == '4'
+ && d->operand[0].mode == VOIDmode)
+ {
+ message_with_line (d->lineno, "missing mode for operand 0 of cstore");
+ have_error = 1;
+ }
+}
/* Look at a define_insn just read. Assign its code number. Record
on idata the template and the number of arguments. If the insn has
@@ -871,6 +887,7 @@ gen_insn (rtx insn, int lineno)
#endif
validate_insn_operands (d);
validate_insn_alternatives (d);
+ validate_optab_operands (d);
place_operands (d);
process_template (d, XTMPL (insn, 3));
}
@@ -956,6 +973,7 @@ gen_expand (rtx insn, int lineno)
d->output_format = INSN_OUTPUT_FORMAT_NONE;
validate_insn_alternatives (d);
+ validate_optab_operands (d);
place_operands (d);
}