This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[gold commit] PR gold/19577: Fix compile errors about shift counts too large
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Sat, 6 Feb 2016 18:17:36 -0800
- Subject: [gold commit] PR gold/19577: Fix compile errors about shift counts too large
- Authentication-results: sourceware.org; auth=none
In order to get around the optimizer and newer compiler warnings
about shift counts, the overflow checking code had resorted to
some messy shifting, and with the never-before-seen instantiations
of the template functions, we were still running afoul of the
compiler checks.
This patch replaces those messy shift sequences with a simple
class template that provides the min and max limits for any
bit size up to 64, with a specialization for 64 that prevents
the compiler from complaining.
2016-02-06 Cary Coutant <ccoutant@gmail.com>
gold/
PR gold/19577
* reloc.h (Limits): New class.
(Bits::has_overflow32): Use min/max values from Limits.
(Bits::has_unsigned_overflow32): Likewise.
(Bits::has_signed_unsigned_overflow32): Likewise.
(Bits::has_overflow): Likewise.
(Bits::has_unsigned_overflow): Likewise.
(Bits::has_signed_unsigned_overflow64): Likewise.