This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][arm] build fix for gcc-6 -Werror=shift-negative-value
- From: Andreas Schwab <schwab at suse dot de>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 15 Jun 2015 14:03:09 +0200
- Subject: Re: [PATCH][arm] build fix for gcc-6 -Werror=shift-negative-value
- Authentication-results: sourceware.org; auth=none
- References: <557EBB7A dot 4060607 at arm dot com>
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;
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."