aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-09-02 10:24:31 +0930
committerAlan Modra <amodra@gmail.com>2020-09-02 16:30:43 +0930
commit6228e2790a72b3335e12d7604ba60f0d3fa1c880 (patch)
tree94aaa51cdce933b6a06257f1755d33061ffc8b7d /gas
parent1929210d46cdf331fce175f0c4124777c0b12d18 (diff)
downloadgdb-6228e2790a72b3335e12d7604ba60f0d3fa1c880.zip
gdb-6228e2790a72b3335e12d7604ba60f0d3fa1c880.tar.gz
gdb-6228e2790a72b3335e12d7604ba60f0d3fa1c880.tar.bz2
ubsan: tc-sparc.c:1146 left shift cannot be represented
* config/tc-sparc.c (in_signed_range): Use an unsigned type for sign mask.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-sparc.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index b6bc209..d6b58b4 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
2020-09-02 Alan Modra <amodra@gmail.com>
+ * config/tc-sparc.c (in_signed_range): Use an unsigned type for
+ sign mask.
+
+2020-09-02 Alan Modra <amodra@gmail.com>
+
* config/tc-nios2.c (md_apply_fix): Avoid too large shift.
2020-09-02 Alan Modra <amodra@gmail.com>
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index d48112e..d728d26 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)