From: Alan Modra Date: Wed, 2 Sep 2020 00:54:31 +0000 (+0930) Subject: ubsan: tc-sparc.c:1146 left shift cannot be represented X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6228e2790a72b3335e12d7604ba60f0d3fa1c880;p=binutils-gdb.git ubsan: tc-sparc.c:1146 left shift cannot be represented * config/tc-sparc.c (in_signed_range): Use an unsigned type for sign mask. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index b6bc2099cd7..d6b58b48527 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2020-09-02 Alan Modra + + * config/tc-sparc.c (in_signed_range): Use an unsigned type for + sign mask. + 2020-09-02 Alan Modra * config/tc-nios2.c (md_apply_fix): Avoid too large shift. diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index d48112ec0af..d728d26531f 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1143,7 +1143,7 @@ in_signed_range (bfd_signed_vma val, bfd_signed_vma max) 0xffffffff is always considered -1 on sparc32. */ if (sparc_arch_size == 32) { - bfd_signed_vma sign = (bfd_signed_vma) 1 << 31; + bfd_vma sign = (bfd_vma) 1 << 31; val = ((val & U0xffffffff) ^ sign) - sign; } if (val > max)