From bf3d139947aa7f846b463db4a7c4b6059a183e11 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 21 Nov 2017 10:25:18 +1030 Subject: [PATCH] xtensa error message * config/tc-xtensa.c (finish_vinsn): Avoid multiple ngettext calls in error message. --- gas/ChangeLog | 5 +++++ gas/config/tc-xtensa.c | 22 ++++++---------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 08553c2455f..24be5694f42 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2017-11-21 Alan Modra + + * config/tc-xtensa.c (finish_vinsn): Avoid multiple ngettext calls + in error message. + 2017-11-20 Alan Modra * testsuite/gas/i386/x86-64-reg-bad.l: Accept trailing padding. diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 3fe85d2ec09..a48ce1e5437 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -6323,6 +6323,7 @@ finish_vinsn (vliw_insn *vinsn) { IStack slotstack; int i; + int slots; if (find_vinsn_conflicts (vinsn)) { @@ -6334,7 +6335,8 @@ finish_vinsn (vliw_insn *vinsn) if (vinsn->format == XTENSA_UNDEFINED) vinsn->format = xg_find_narrowest_format (vinsn); - if (xtensa_format_num_slots (xtensa_default_isa, vinsn->format) > 1 + slots = xtensa_format_num_slots (xtensa_default_isa, vinsn->format); + if (slots > 1 && produce_flix == FLIX_NONE) { as_bad (_("The option \"--no-allow-flix\" prohibits multi-slot flix.")); @@ -6355,23 +6357,11 @@ finish_vinsn (vliw_insn *vinsn) return; } - if (vinsn->num_slots - != xtensa_format_num_slots (xtensa_default_isa, vinsn->format)) + if (vinsn->num_slots != 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), + as_bad (_("mismatch for format '%s': #slots = %d, #opcodes = %d"), + xtensa_format_name (xtensa_default_isa, vinsn->format), slots, vinsn->num_slots); - free (msg); xg_clear_vinsn (vinsn); return; } -- 2.30.2