From 6e98b3428bdd0bf388c3c72eb205105926b15a64 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 7 Nov 2017 17:03:41 +1030 Subject: [PATCH] xtensa message pluralization * config/tc-xtensa.c (finish_vinsn): Properly pluralize error message. --- gas/ChangeLog | 4 ++++ gas/config/tc-xtensa.c | 18 ++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 80e9ea751cf..c13f9b164b8 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2017-11-08 Alan Modra + + * config/tc-xtensa.c (finish_vinsn): Properly pluralize error message. + 2017-11-07 Jim Wilson * config/tc-riscv.c (append_insn): Call frag_wane and frag_new at diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index a73abd08ed5..3fe85d2ec09 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -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; } -- 2.30.2