Skip to content

Commit

Permalink
RISC-V: Improve "bits undefined" diagnostics
Browse files Browse the repository at this point in the history
This commit improves internal error message
"internal: bad RISC-V opcode (bits 0x%lx undefined): %s %s"
to display actual unused bits (excluding non-instruction bits).

gas/ChangeLog:

	* config/tc-riscv.c (validate_riscv_insn): Exclude non-
	instruction bits from displaying internal diagnostics.
	Change error message slightly.
  • Loading branch information
a4lg committed Oct 28, 2022
1 parent cda6cb9 commit 22a33a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gas/config/tc-riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,8 +1398,8 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length)
if (used_bits != required_bits)
{
as_bad (_("internal: bad RISC-V opcode "
"(bits 0x%lx undefined): %s %s"),
~(unsigned long)(used_bits & required_bits),
"(bits %#llx undefined or invalid): %s %s"),
(unsigned long long)(used_bits ^ required_bits),
opc->name, opc->args);
return false;
}
Expand Down

0 comments on commit 22a33a9

Please sign in to comment.