From 3b8d6e21845bfc0d5447547093a9c3afb0dbbcd1 Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Thu, 7 Jul 2022 13:20:11 +0900 Subject: [PATCH] RISC-V: Fix required bits on certain environments If `unsigned long long' type has more than 64-bits, validate_riscv_insn function generated wrong required_bits value. This commit fixes this small issue (may be too pedantic though). gas/ChangeLog: * config/tc-riscv.c (validate_riscv_insn): Compute correct required_bits value when unsigned long long is larger than 64b. --- gas/config/tc-riscv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 6db444b654f..2302506d542 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -1110,7 +1110,7 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length) else insn_width = 8 * length; - required_bits = ~0ULL >> (64 - insn_width); + required_bits = ((insn_t)~0ULL) >> (64 - insn_width); if ((used_bits & opc->match) != (opc->match & required_bits)) {