xtensa error message

* config/tc-xtensa.c (finish_vinsn): Avoid multiple ngettext calls
	in error message.
This commit is contained in:
Alan Modra 2017-11-21 10:25:18 +10:30
parent e6b2f5efa9
commit bf3d139947
2 changed files with 11 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2017-11-21 Alan Modra <amodra@gmail.com>
* config/tc-xtensa.c (finish_vinsn): Avoid multiple ngettext calls
in error message.
2017-11-20 Alan Modra <amodra@gmail.com>
* testsuite/gas/i386/x86-64-reg-bad.l: Accept trailing padding.

View File

@ -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;
}