diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2021-05-17 13:44:49 +0100 |
---|---|---|
committer | Joern Rennecke <joern.rennecke@embecosm.com> | 2021-05-17 13:44:49 +0100 |
commit | bdd8e3dd60c4f6080df74fe02b6579451fda6a21 (patch) | |
tree | f6a010839f498836d2bfeb0b2087aad90400bfce /gcc | |
parent | 7606865198b241b4c944f66761d6506b02ead951 (diff) | |
download | gcc-bdd8e3dd60c4f6080df74fe02b6579451fda6a21.zip gcc-bdd8e3dd60c4f6080df74fe02b6579451fda6a21.tar.gz gcc-bdd8e3dd60c4f6080df74fe02b6579451fda6a21.tar.bz2 |
Improve message for wrong number of alternatives.
gcc/
* genoutput.c (validate_insn_alternatives) Make "wrong number of
alternatives" message more specific, and remove assumption on where
the problem is.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/genoutput.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 8e911cc..6d4ab81 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -757,6 +757,7 @@ validate_insn_alternatives (class data *d) int which_alternative = 0; int alternative_count_unsure = 0; bool seen_write = false; + bool alt_mismatch = false; for (p = d->operand[start].constraint; (c = *p); p += len) { @@ -813,8 +814,19 @@ validate_insn_alternatives (class data *d) if (n == 0) n = d->operand[start].n_alternatives; else if (n != d->operand[start].n_alternatives) - error_at (d->loc, "wrong number of alternatives in operand %d", - start); + { + if (!alt_mismatch) + { + alt_mismatch = true; + error_at (d->loc, + "alternative number mismatch: " + "operand %d has %d, operand %d has %d", + 0, n, start, d->operand[start].n_alternatives); + } + else + error_at (d->loc, "operand %d has %d alternatives", + start, d->operand[start].n_alternatives); + } } } |