diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index a0e8456a0d1..8a961c05d95 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -1265,8 +1265,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 0x%lx undefined or invalid): %s %s"), + (unsigned long)(used_bits ^ required_bits), opc->name, opc->args); return false; }