diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 3355bfbbfb2..f90ce0a6650 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)) {