This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gold commit] PR gold/19577: Fix compile errors about shift counts too large


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]