xtensa message pluralization

* config/tc-xtensa.c (finish_vinsn): Properly pluralize error message.
This commit is contained in:
Alan Modra 2017-11-07 17:03:41 +10:30
parent b346cb961f
commit 6e98b3428b
2 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2017-11-08 Alan Modra <amodra@gmail.com>
* config/tc-xtensa.c (finish_vinsn): Properly pluralize error message.
2017-11-07 Jim Wilson <jimw@sifive.com>
* config/tc-riscv.c (append_insn): Call frag_wane and frag_new at

View File

@ -6358,10 +6358,20 @@ finish_vinsn (vliw_insn *vinsn)
if (vinsn->num_slots
!= xtensa_format_num_slots (xtensa_default_isa, vinsn->format))
{
as_bad (_("format '%s' allows %d slots, but there are %d opcodes"),
xtensa_format_name (xtensa_default_isa, vinsn->format),
xtensa_format_num_slots (xtensa_default_isa, vinsn->format),
vinsn->num_slots);
char *msg;
int slots = xtensa_format_num_slots (xtensa_default_isa, vinsn->format);
msg = concat (ngettext ("format '%s' allows %d slot, ",
"format '%s' allows %d slots, ",
slots),
ngettext ("but there is %d opcode",
"but there are %d opcodes",
vinsn->num_slots),
(const char *) 0);
as_bad (msg, xtensa_format_name (xtensa_default_isa, vinsn->format),
slots, vinsn->num_slots);
free (msg);
xg_clear_vinsn (vinsn);
return;
}