https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99434

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Testcase without includes:
template<typename _To, typename _From>
constexpr _To
bit_cast(const _From& __from) noexcept
{
  return __builtin_bit_cast(_To, __from);
}

struct u64x2_t
{
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
  unsigned long long high,low;
#else
  unsigned long long low,high;
#endif
};
u64x2_t umul5(unsigned long long a,unsigned long long b) noexcept
{
  return bit_cast<u64x2_t>(static_cast<__uint128_t>(a)*b);
}

u64x2_t umul_builtin(unsigned long long a,unsigned long long b) noexcept
{
  return __builtin_bit_cast(u64x2_t,static_cast<__uint128_t>(a)*b);
}

Reply via email to