[PATCH v2 2/2] RISC-V: Improve "bits undefined" diagnostics

Jan Beulich jbeulich@suse.com
Thu Oct 6 08:26:21 GMT 2022


On 06.10.2022 06:40, Tsukasa OI via Binutils wrote:
> --- a/gas/config/tc-riscv.c
> +++ b/gas/config/tc-riscv.c
> @@ -1312,8 +1312,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%llx undefined or invalid): %s %s"),
> +	      (unsigned long long)(used_bits ^ required_bits),

May I encourage the use of the # format modifier in cases like this
one (i.e. %#llx here), for producing a one character shorter string
literal? Iirc a respective adjustment was done pretty recently to
some other parts of binutils.

Jan


More information about the Binutils mailing list