ubsan: d30v: negation of -2147483648

Message ID 20200204034147.GQ30118@bubble.grove.modra.org
State New
Headers show
Series
  • ubsan: d30v: negation of -2147483648
Related show

Commit Message

Alan Modra Feb. 4, 2020, 3:41 a.m.
include/
	* opcode/d30v.h (struct pd_reg): Make value field unsigned.
opcodes/
	* d30v-dis.c (print_insn): Make "val" and "opnum" unsigned.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/include/opcode/d30v.h b/include/opcode/d30v.h
index 2694d6d0e9..4ba2c45c84 100644
--- a/include/opcode/d30v.h
+++ b/include/opcode/d30v.h
@@ -33,7 +33,7 @@  struct pd_reg
 {
   char *name;		/* name to recognize */
   char *pname;		/* name to print for this register */
-  int value;
+  unsigned int value;
 };
 
 extern const struct pd_reg pre_defined_registers[];
diff --git a/opcodes/d30v-dis.c b/opcodes/d30v-dis.c
index 212d24a708..ba43731122 100644
--- a/opcodes/d30v-dis.c
+++ b/opcodes/d30v-dis.c
@@ -123,9 +123,9 @@  print_insn (struct disassemble_info *info,
 	    int is_long,
 	    int show_ext)
 {
-  int val, opnum, need_comma = 0;
+  unsigned int val, opnum;
   const struct d30v_operand *oper;
-  int i, match, need_paren = 0, found_control = 0;
+  int i, match, need_comma = 0, need_paren = 0, found_control = 0;
   unsigned int opind = 0;
 
   (*info->fprintf_func) (info->stream, "%s", insn->op->name);