[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/19577] Gold failed to build with GCC 5.3
From: |
hjl.tools at gmail dot com |
Subject: |
[Bug gold/19577] Gold failed to build with GCC 5.3 |
Date: |
Sat, 06 Feb 2016 17:40:52 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=19577
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
powerpc.cc has working address overflow check:
template<int size, bool big_endian>
class Powerpc_relocate_functions
{
public:
enum Overflow_check
{
CHECK_NONE,
CHECK_SIGNED,
CHECK_UNSIGNED,
CHECK_BITFIELD,
CHECK_LOW_INSN,
CHECK_HIGH_INSN
};
enum Status
{
STATUS_OK,
STATUS_OVERFLOW
};
private:
typedef Powerpc_relocate_functions<size, big_endian> This;
typedef typename elfcpp::Elf_types<size>::Elf_Addr Address;
typedef typename elfcpp::Elf_types<size>::Elf_Swxword SignedAddress;
template<int valsize>
static inline bool
has_overflow_signed(Address value)
{
// limit = 1 << (valsize - 1) without shift count exceeding size of type
Address limit = static_cast<Address>(1) << ((valsize - 1) >> 1);
limit <<= ((valsize - 1) >> 1);
limit <<= ((valsize - 1) - 2 * ((valsize - 1) >> 1));
return value + limit > (limit << 1) - 1;
}
template<int valsize>
static inline bool
has_overflow_unsigned(Address value)
{
Address limit = static_cast<Address>(1) << ((valsize - 1) >> 1);
limit <<= ((valsize - 1) >> 1);
limit <<= ((valsize - 1) - 2 * ((valsize - 1) >> 1));
return value > (limit << 1) - 1;
}
template<int valsize>
static inline bool
has_overflow_bitfield(Address value)
{
return (has_overflow_unsigned<valsize>(value)
&& has_overflow_signed<valsize>(value));
}
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/19577] New: Gold failed to build with GCC 5.3, hjl.tools at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, hjl.tools at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3,
hjl.tools at gmail dot com <=
- [Bug gold/19577] Gold failed to build with GCC 5.3, hjl.tools at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, ccoutant at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, ccoutant at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, cvs-commit at gcc dot gnu.org, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, hjl.tools at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, ccoutant at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, ccoutant at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, cvs-commit at gcc dot gnu.org, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, ccoutant at gmail dot com, 2016/02/06
- [Bug gold/19577] Gold failed to build with GCC 5.3, hjl.tools at gmail dot com, 2016/02/06