public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PR26497 UBSAN: tc-sh.c:2467 left shift cannot be represented
@ 2020-08-31 10:50 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2020-08-31 10:50 UTC (permalink / raw)
  To: binutils

	PR 26497
	* config/tc-sh.c (assemble_ppi): Use unsigned variables.

diff --git a/gas/config/tc-sh.c b/gas/config/tc-sh.c
index e1e509d7d2..ea9052286a 100644
--- a/gas/config/tc-sh.c
+++ b/gas/config/tc-sh.c
@@ -2205,12 +2205,12 @@ find_cooked_opcode (char **str_p)
 static unsigned int
 assemble_ppi (char *op_end, sh_opcode_info *opcode)
 {
-  int movx = 0;
-  int movy = 0;
-  int cond = 0;
-  int field_b = 0;
+  unsigned int movx = 0;
+  unsigned int movy = 0;
+  unsigned int cond = 0;
+  unsigned int field_b = 0;
   char *output;
-  int move_code;
+  unsigned int move_code;
   unsigned int size;
 
   for (;;)
@@ -2464,7 +2464,7 @@ assemble_ppi (char *op_end, sh_opcode_info *opcode)
   if (field_b)
     {
       /* Parallel processing insn.  */
-      unsigned long ppi_code = (movx | movy | 0xf800) << 16 | field_b;
+      unsigned int ppi_code = (movx | movy | 0xf800) << 16 | field_b;
 
       output = frag_more (4);
       size = 4;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-31 10:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31 10:50 PR26497 UBSAN: tc-sh.c:2467 left shift cannot be represented Alan Modra

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).