summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-23 18:04:12 +1030
committerAlan Modra <amodra@gmail.com>2019-12-23 18:04:12 +1030
commit3e1056a1a6336f289d3f0def8f6a3632c8a75393 (patch)
tree179580314154fe4df22e7b2ea548366f999aca28 /cpu
parent1a1e2852a56da48da1f3b5c80d23c3998a9000fc (diff)
downloadbinutils-gdb-3e1056a1a6336f289d3f0def8f6a3632c8a75393.tar.gz
ubsan: iq2000: left shift of negative value
cpu/ * iq2000.cpu (f-offset): Avoid left shift of negative values. opcodes/ * iq2000-ibld.c: Regenerate.
Diffstat (limited to 'cpu')
-rw-r--r--cpu/ChangeLog4
-rw-r--r--cpu/iq2000.cpu2
2 files changed, 5 insertions, 1 deletions
diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index 1729efd266c..3e6a8d8c4d0 100644
--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,7 @@
+2019-12-23 Alan Modra <amodra@gmail.com>
+
+ * iq2000.cpu (f-offset): Avoid left shift of negative values.
+
2019-12-20 Alan Modra <amodra@gmail.com>
* or1korbis.cpu (f-disp26, f-disp21): Don't left shift negative values.
diff --git a/cpu/iq2000.cpu b/cpu/iq2000.cpu
index e25ba69392b..cb9cfae1d43 100644
--- a/cpu/iq2000.cpu
+++ b/cpu/iq2000.cpu
@@ -207,7 +207,7 @@
(df f-offset "pc offset field" (PCREL-ADDR) 15 16 INT
; Actually, this is relative to the address of the delay slot.
((value pc) (sra SI (sub SI value pc) 2))
- ((value pc) (add SI (sll SI value 2) (add pc 4))))
+ ((value pc) (add SI (mul SI value 4) (add pc 4))))
; Instruction fields that scarcely appear in instructions.