From 33e62913f776d641aa54f106d442f55aacda789d Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 7 Jan 2026 15:01:08 -0500 Subject: [PATCH 1/2] Remove workaround --- test/github_issue_1260.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/github_issue_1260.cpp b/test/github_issue_1260.cpp index dc5af98f2..3a8e01663 100644 --- a/test/github_issue_1260.cpp +++ b/test/github_issue_1260.cpp @@ -23,13 +23,8 @@ void test() int main() { - // TODO(mborland): GCC 12+ in 32 bit compilations only with release mode fail - #ifndef __i386__ - test(); test(); - #endif - return boost::report_errors(); } From 2952aa3f89f8f008d511233f7c6651f5a7321018 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Wed, 7 Jan 2026 15:01:21 -0500 Subject: [PATCH 2/2] Fix strict aliasing violations --- .../detail/int128/detail/uint128_imp.hpp | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/include/boost/decimal/detail/int128/detail/uint128_imp.hpp b/include/boost/decimal/detail/int128/detail/uint128_imp.hpp index ec48af6b7..c1c2a6469 100644 --- a/include/boost/decimal/detail/int128/detail/uint128_imp.hpp +++ b/include/boost/decimal/detail/int128/detail/uint128_imp.hpp @@ -674,8 +674,10 @@ constexpr bool operator<(const uint128_t lhs, const uint128_t rhs) noexcept } else { - const uint32_t* l = reinterpret_cast(&lhs); - const uint32_t* r = reinterpret_cast(&rhs); + std::uint32_t l[4] {}; + std::uint32_t r[4] {}; + std::memcpy(l, &lhs, sizeof(lhs)); + std::memcpy(r, &rhs, sizeof(rhs)); if (l[3] != r[3]) { @@ -827,8 +829,10 @@ constexpr bool operator<=(const uint128_t lhs, const uint128_t rhs) noexcept } else { - const uint32_t* l = reinterpret_cast(&lhs); - const uint32_t* r = reinterpret_cast(&rhs); + std::uint32_t l[4] {}; + std::uint32_t r[4] {}; + std::memcpy(l, &lhs, sizeof(lhs)); + std::memcpy(r, &rhs, sizeof(rhs)); if (l[3] != r[3]) { @@ -980,8 +984,10 @@ constexpr bool operator>(const uint128_t lhs, const uint128_t rhs) noexcept } else { - const uint32_t* l = reinterpret_cast(&lhs); - const uint32_t* r = reinterpret_cast(&rhs); + std::uint32_t l[4] {}; + std::uint32_t r[4] {}; + std::memcpy(l, &lhs, sizeof(lhs)); + std::memcpy(r, &rhs, sizeof(rhs)); if (l[3] != r[3]) { @@ -1133,8 +1139,10 @@ constexpr bool operator>=(const uint128_t lhs, const uint128_t rhs) noexcept } else { - const uint32_t* l = reinterpret_cast(&lhs); - const uint32_t* r = reinterpret_cast(&rhs); + std::uint32_t l[4] {}; + std::uint32_t r[4] {}; + std::memcpy(l, &lhs, sizeof(lhs)); + std::memcpy(r, &rhs, sizeof(rhs)); if (l[3] != r[3]) {