https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87744
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:c9ce332b557bb95987d038d98ea929cdfd1eae1d commit r14-8998-gc9ce332b557bb95987d038d98ea929cdfd1eae1d Author: Jonathan Wakely <jwak...@redhat.com> Date: Wed Feb 7 11:31:10 2024 +0000 libstdc++: Use 128-bit arithmetic for std::linear_congruential_engine [PR87744] For 32-bit targets without __int128 we need to implement the LCG transition function by hand using 64-bit types. We can also slightly simplify the __mod function by using if-constexpr unconditionally, disabling -Wc++17-extensions warnings with diagnostic pragmas. libstdc++-v3/ChangeLog: PR libstdc++/87744 * include/bits/random.h [!__SIZEOF_INT128__] (_Select_uint_least_t): Define specialization for 64-bit generators with non-power-of-two modulus and large constants. (__mod): Use if constexpr unconditionally. * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line number. * testsuite/26_numerics/random/linear_congruential_engine/87744.cc: New test.