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: moxie: left shift of negative value
Date: Mon, 16 Dec 2019 21:25:00 -0000	[thread overview]
Message-ID: <cf950fd4dd4581849a445a76b57514d72074927d@gdb-build> (raw)

*** TEST RESULTS FOR COMMIT cf950fd4dd4581849a445a76b57514d72074927d ***

commit cf950fd4dd4581849a445a76b57514d72074927d
Author:     Alan Modra <amodra@gmail.com>
AuthorDate: Mon Dec 16 09:57:22 2019 +1030
Commit:     Alan Modra <amodra@gmail.com>
CommitDate: Mon Dec 16 17:28:52 2019 +1030

    ubsan: moxie: left shift of negative value
    
    Commit 8c9b4171877df didn't remove a glaring left shift of a number
    that had just been sign extended.
    
            * moxie-dis.c (INST2OFFSET): Don't left shift a signed value.
            (print_insn_moxie): Remove unnecessary cast.

diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 9e0d57b7c9..2d1c9d3f7d 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-16  Alan Modra  <amodra@gmail.com>
+
+	* moxie-dis.c (INST2OFFSET): Don't left shift a signed value.
+	(print_insn_moxie): Remove unnecessary cast.
+
 2019-12-12  Alan Modra  <amodra@gmail.com>
 
 	* csky-dis.c (csky_chars_to_number): Remove abort and unnecessary
diff --git a/opcodes/moxie-dis.c b/opcodes/moxie-dis.c
index cbfcf95880..1d06e18479 100644
--- a/opcodes/moxie-dis.c
+++ b/opcodes/moxie-dis.c
@@ -33,7 +33,7 @@ static void *stream;
 /* Macros to extract operands from the instruction word.  */
 #define OP_A(i) ((i >> 4) & 0xf)
 #define OP_B(i) (i & 0xf)
-#define INST2OFFSET(o) (((((o) & 0x3ff) ^ 0x200) - 0x200) << 1)
+#define INST2OFFSET(o) (((((o) & 0x3ff) ^ 0x200) - 0x200) * 2)
 
 static const char * reg_names[16] =
   { "$fp", "$sp", "$r0", "$r1", "$r2", "$r3", "$r4", "$r5",
@@ -210,8 +210,7 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info)
 	{
 	case MOXIE_F3_PCREL:
 	  fpr (stream, "%s\t", opcode->name);
-	  info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword) + 2),
-				    info);
+	  info->print_address_func (addr + INST2OFFSET (iword) + 2, info);
 	  break;
         case MOXIE_BAD:
 	  fpr (stream, "bad");


             reply	other threads:[~2019-12-16 21:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-16 21:25 gdb-buildbot [this message]
2019-12-16 21:42 ` Failures on Ubuntu-Aarch64-native-extended-gdbserver-m64, branch master gdb-buildbot
2019-12-16 22:17 ` Failures on Ubuntu-Aarch64-native-gdbserver-m64, " gdb-buildbot
2019-12-18 13:36 ` Failures on Fedora-i686, " gdb-buildbot
2019-12-18 14:34 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot
2019-12-18 14:43 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
2019-12-18 14:59 ` Failures on Fedora-x86_64-native-gdbserver-m64, " gdb-buildbot
2019-12-18 15:18 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot
  -- strict thread matches above, loose matches on Subject: below --
2019-12-11 11:58 [binutils-gdb] ubsan: moxie: left shift of negative value 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=cf950fd4dd4581849a445a76b57514d72074927d@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).