aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-03-10 21:52:50 +1030
committerAlan Modra <amodra@gmail.com>2020-03-10 21:56:42 +1030
commita6a1f5e050c3d4444b8074ba9ba02f547b725892 (patch)
tree148949871d0afd71346130e2e8cbb7dc60024dde /gas/config/tc-mips.c
parente10ac147c80240c2d0aa0a2ae2ec7f6a934c198f (diff)
downloadbinutils-a6a1f5e050c3d4444b8074ba9ba02f547b725892.zip
binutils-a6a1f5e050c3d4444b8074ba9ba02f547b725892.tar.gz
binutils-a6a1f5e050c3d4444b8074ba9ba02f547b725892.tar.bz2
More 1 << 31 signed overflows
* config/tc-csky.c (get_operand_value): Rewrite 1 << 31 expressions to avoid signed overflow. * config/tc-mcore.c (md_assemble): Likewise. * config/tc-mips.c (gpr_read_mask, gpr_write_mask): Likewise. * config/tc-nds32.c (SET_ADDEND): Likewise. * config/tc-nios2.c (nios2_assemble_arg_R): Likewise.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 9f78b5a..31acb77 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -4778,7 +4778,7 @@ gpr_read_mask (const struct mips_cl_insn *ip)
if (pinfo2 & INSN2_READ_SP)
mask |= 1 << SP;
if (pinfo2 & INSN2_READ_GPR_31)
- mask |= 1 << 31;
+ mask |= 1u << 31;
/* Don't include register 0. */
return mask & ~1;
}
@@ -4797,7 +4797,7 @@ gpr_write_mask (const struct mips_cl_insn *ip)
if (pinfo & INSN_WRITE_GPR_24)
mask |= 1 << 24;
if (pinfo & INSN_WRITE_GPR_31)
- mask |= 1 << 31;
+ mask |= 1u << 31;
if (pinfo & INSN_UDI)
/* UDI instructions have traditionally been assumed to write to RD. */
mask |= 1 << EXTRACT_OPERAND (mips_opts.micromips, RD, *ip);