aboutsummaryrefslogtreecommitdiff
path: root/gcc/genextract.c
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2009-04-08 15:00:34 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2009-04-08 15:00:34 +0000
commit7ddf71e3171fb2d809e7baf6a94c9243b8d9fcac (patch)
treea0c23b6e97fff3605468cc753addf1d49c74ad81 /gcc/genextract.c
parented57136d4a6bbf190126322a818175debee588b4 (diff)
downloadgcc-7ddf71e3171fb2d809e7baf6a94c9243b8d9fcac.zip
gcc-7ddf71e3171fb2d809e7baf6a94c9243b8d9fcac.tar.gz
gcc-7ddf71e3171fb2d809e7baf6a94c9243b8d9fcac.tar.bz2
genoutput.c (validate_optab_operands): New.
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. From-SVN: r145746
Diffstat (limited to 'gcc/genextract.c')
-rw-r--r--gcc/genextract.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/genextract.c b/gcc/genextract.c
index c983110..c414891 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -80,6 +80,8 @@ struct accum_extract
VEC(char,heap) *pathstr;
};
+int line_no;
+
/* Forward declarations. */
static void walk_rtx (rtx, struct accum_extract *);
@@ -187,8 +189,13 @@ VEC_safe_set_locstr (VEC(locstr,heap) **vp, unsigned int ix, char *str)
{
if (ix < VEC_length (locstr, *vp))
{
- gcc_assert (VEC_index (locstr, *vp, ix) == 0);
- VEC_replace (locstr, *vp, ix, str);
+ if (VEC_index (locstr, *vp, ix))
+ {
+ message_with_line (line_no, "repeated operand number %d", ix);
+ have_error = 1;
+ }
+ else
+ VEC_replace (locstr, *vp, ix, str);
}
else
{
@@ -399,7 +406,6 @@ main (int argc, char **argv)
struct code_ptr *link;
const char *name;
int insn_code_number;
- int line_no;
progname = "genextract";
@@ -423,6 +429,9 @@ main (int argc, char **argv)
}
}
+ if (have_error)
+ return FATAL_EXIT_CODE;
+
print_header ();
/* Write out code to handle peepholes and the insn_codes that it should