aboutsummaryrefslogtreecommitdiff
path: root/opcodes/xc16x-ibld.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-09-02 10:35:10 +0930
committerAlan Modra <amodra@gmail.com>2020-09-02 16:30:44 +0930
commitae3e98b418c6f31cc1999d67fc2422429d88de6f (patch)
tree87743aa47935a0e3fe6efaf8959bb0fe62240128 /opcodes/xc16x-ibld.c
parent427202d96790f1b659e0fa9485b8128c95dc48db (diff)
downloadgdb-ae3e98b418c6f31cc1999d67fc2422429d88de6f.zip
gdb-ae3e98b418c6f31cc1999d67fc2422429d88de6f.tar.gz
gdb-ae3e98b418c6f31cc1999d67fc2422429d88de6f.tar.bz2
ubsan: *-ibld.c
bfin-dis.c:160 shift exponent 32 is too large for 32-bit type 'long unsigned int' bpf-ibld.c:196 left shift of 1 by 31 places cannot be represented in type 'long int' bpf-ibld.c:196 negation of -2147483648 cannot be represented in type 'long int'; cast to an unsigned type to negate this itself bpf-ibld.c:197 left shift of 1 by 31 places cannot be represented in type 'long int' bpf-ibld.c:197 signed integer overflow: -2147483648 - 1 cannot be represented in type 'long int' bpf-ibld.c:501 left shift of 1 by 31 places cannot be represented in type 'long int' * cgen-ibld.in (insert_normal, extract_normal): Use 1UL in left shift. * bpf-ibld.c: Regenerate. * epiphany-ibld.c: Regenerate. * fr30-ibld.c: Regenerate. * frv-ibld.c: Regenerate. * ip2k-ibld.c: Regenerate. * iq2000-ibld.c: Regenerate. * lm32-ibld.c: Regenerate. * m32c-ibld.c: Regenerate. * m32r-ibld.c: Regenerate. * mep-ibld.c: Regenerate. * mt-ibld.c: Regenerate. * or1k-ibld.c: Regenerate. * xc16x-ibld.c: Regenerate. * xstormy16-ibld.c: Regenerate.
Diffstat (limited to 'opcodes/xc16x-ibld.c')
-rw-r--r--opcodes/xc16x-ibld.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/opcodes/xc16x-ibld.c b/opcodes/xc16x-ibld.c
index ed51a1b..9b87c3b 100644
--- a/opcodes/xc16x-ibld.c
+++ b/opcodes/xc16x-ibld.c
@@ -155,7 +155,7 @@ insert_normal (CGEN_CPU_DESC cd,
/* Ensure VALUE will fit. */
if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGN_OPT))
{
- long minval = - (1L << (length - 1));
+ long minval = - (1UL << (length - 1));
unsigned long maxval = mask;
if ((value > 0 && (unsigned long) value > maxval)
@@ -193,8 +193,8 @@ insert_normal (CGEN_CPU_DESC cd,
{
if (! cgen_signed_overflow_ok_p (cd))
{
- long minval = - (1L << (length - 1));
- long maxval = (1L << (length - 1)) - 1;
+ long minval = - (1UL << (length - 1));
+ long maxval = (1UL << (length - 1)) - 1;
if (value < minval || value > maxval)
{
@@ -498,7 +498,7 @@ extract_normal (CGEN_CPU_DESC cd,
value &= mask;
/* sign extend? */
if (CGEN_BOOL_ATTR (attrs, CGEN_IFLD_SIGNED)
- && (value & (1L << (length - 1))))
+ && (value & (1UL << (length - 1))))
value |= ~mask;
*valuep = value;