diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-02-07 11:31:10 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-02-15 11:43:21 +0000 |
commit | c9ce332b557bb95987d038d98ea929cdfd1eae1d (patch) | |
tree | d992d060ba112ffde308bdf9571af8078a9348ba /gcc/fortran | |
parent | f0e2714f241b1dcf867c2cfc5586bdea63dbf891 (diff) | |
download | gcc-c9ce332b557bb95987d038d98ea929cdfd1eae1d.zip gcc-c9ce332b557bb95987d038d98ea929cdfd1eae1d.tar.gz gcc-c9ce332b557bb95987d038d98ea929cdfd1eae1d.tar.bz2 |
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.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions