ubsan: nds32: left shift cannot be represented in type 'int'
authorAlan Modra <amodra@gmail.com>
Sun, 15 Dec 2019 23:05:30 +0000 (09:35 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 16 Dec 2019 07:03:53 +0000 (17:33 +1030)
commit4bdb25fe6902963ca9cf91d6b2688cf888527bf8
treec59b543c40bf8bc2d741c3b0ed2b1a5a7397746a
parentcf950fd4dd4581849a445a76b57514d72074927d
ubsan: nds32: left shift cannot be represented in type 'int'

Note that using 1u in N32_BIT makes all of N32_BIT, __MASK, __MF, __GF
and __SEXT evaluate as unsigned int (the latter three when when their
v arg is int or smaller).  This would be a problem if assigning the
result to a bfd_vma, long, or other type wider than an int since the
__SEXT result would be zero extended to the wider type.  Fortunately
nds32 target code doesn't use wider types unnecessarily.

include/
* opcode/nds32.h (N32_BIT): Define using 1u.
(__SEXT): Use __MASK and N32_BIT.
(N32_IMMS): Remove duplicate mask.
opcodes/
* nds32-dis.c (print_insn16, print_insn32): Remove forward decls.
(struct objdump_disasm_info): Delete.
(nds32_parse_audio_ext, nds32_parse_opcode): Cast result of
N32_IMMS to unsigned before shifting left.
include/ChangeLog
include/opcode/nds32.h
opcodes/ChangeLog
opcodes/nds32-dis.c
This page took 0.0241 seconds and 4 git commands to generate.