[PATCH][arm] build fix for gcc-6 -Werror=shift-negative-value
Szabolcs Nagy
szabolcs.nagy@arm.com
Mon Jun 15 13:14:00 GMT 2015
On 15/06/15 13:03, Andreas Schwab wrote:
> Szabolcs Nagy <szabolcs.nagy@arm.com> writes:
>
>> - /* Is ``imm'' a negative number? */
>> + /* Is ``imm'' a negative number? Then sign-extend it. */
>> if (imm & 0x40)
>> - imm |= (-1 << 7);
>> + imm |= ~0x7f;
>
> imm = (imm ^ 0x40) - 0x40;
>
hm right, then i don't need assumptions about signed int representation.
imm -= 0x80;
is even simpler, is that ok?
2015-06-15 Szabolcs Nagy <szabolcs.nagy@arm.com>
* opcodes/arm-dis.c (print_insn_coprocessor): Avoid negative shift.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: negshift2.diff
Type: text/x-patch
Size: 347 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150615/54d843a6/attachment.bin>
More information about the Binutils
mailing list