public inbox for gdb-testers@sourceware.org
help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net
To: gdb-testers@sourceware.org
Subject: [binutils-gdb] ubsan: iq2000: left shift of negative value
Date: Mon, 23 Dec 2019 09:34:00 -0000	[thread overview]
Message-ID: <3e1056a1a6336f289d3f0def8f6a3632c8a75393@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT 3e1056a1a6336f289d3f0def8f6a3632c8a75393 ***

commit 3e1056a1a6336f289d3f0def8f6a3632c8a75393
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Mon Dec 23 18:04:12 2019 +1030
Commit:     Alan Modra <amodra@gmail.com>
CommitDate: Mon Dec 23 18:04:12 2019 +1030

    ubsan: iq2000: left shift of negative value
    
    cpu/
            * iq2000.cpu (f-offset): Avoid left shift of negative values.
    opcodes/
            * iq2000-ibld.c: Regenerate.

diff --git a/cpu/ChangeLog b/cpu/ChangeLog
index 1729efd266..3e6a8d8c4d 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 e25ba69392..cb9cfae1d4 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.
 
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 1c5592ae26..c3a97523bc 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,7 @@
+2019-12-23  Alan Modra  <amodra@gmail.com>
+
+	* iq2000-ibld.c: Regenerate.
+
 2019-12-23  Alan Modra  <amodra@gmail.com>
 
 	* d30v-dis.c (extract_value): Make num param a uint64_t, constify
diff --git a/opcodes/iq2000-ibld.c b/opcodes/iq2000-ibld.c
index 34482b366a..3059fe167a 100644
--- a/opcodes/iq2000-ibld.c
+++ b/opcodes/iq2000-ibld.c
@@ -838,7 +838,7 @@ iq2000_cgen_extract_operand (CGEN_CPU_DESC cd,
       {
         long value;
         length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED)|(1<<CGEN_IFLD_PCREL_ADDR), 0, 15, 16, 32, total_length, pc, & value);
-        value = ((((value) << (2))) + (((pc) + (4))));
+        value = ((((value) * (4))) + (((pc) + (4))));
         fields->f_offset = value;
       }
       break;


             reply	other threads:[~2019-12-23  9:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-23  9:34 gdb-buildbot [this message]
2019-12-23  9:32 ` Failures on Ubuntu-Aarch64-m64, branch master gdb-buildbot
2019-12-23 10:14 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2019-12-23 18:18 ` *** COMPILATION FAILED *** Failures on Fedora-i686, branch master *** BREAKAGE *** gdb-buildbot
2019-12-23 18:52 ` Failures on Fedora-x86_64-cc-with-index, branch master gdb-buildbot
2019-12-23 18:57 ` Failures on Fedora-x86_64-m32, " gdb-buildbot
2019-12-23 19:11 ` Failures on Fedora-x86_64-m64, " gdb-buildbot
2019-12-23 19:22 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-12-23 19:25 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-12-23 19:30 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
2019-12-23 19:56 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e1056a1a6336f289d3f0def8f6a3632c8a75393@gdb-build \
    --to=gdb-buildbot@sergiodj.net \
    --cc=gdb-testers@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).