]> git.feebdaed.xyz Git - 0xmirror/gcc.git/commit
libstdc++: Use -fexcess-precision=standard for std::generate_canonical tests
authorJonathan Wakely <jwakely@redhat.com>
Wed, 17 Dec 2025 19:39:39 +0000 (19:39 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 17 Dec 2025 20:41:31 +0000 (20:41 +0000)
commita9eb2f24b01bea3193bdb77cc2aa13d6fbd0f754
treece0749f239d7c1f2c07c6f84232bfde99955268b
parent53893d44f3fec79134f4b43436a7d591985a711d
libstdc++: Use -fexcess-precision=standard for std::generate_canonical tests

On 32-bit x86 the default -fexcess-precision=fast setting used by
-std=gnu++20 results in unpredictable rounding which alters the number
of times that std::generate_canonical produces exactly 1.0f, which
means that the URBG is invoked a different number of times.

To ensure that the behaviour is consistent and the expected number of
calls happens, use -fexcess-precision=standard.

libstdc++-v3/ChangeLog:

* testsuite/26_numerics/random/uniform_real_distribution/operators/64351.cc:
Add -fexcess-precision=standard to options.
* testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc:
Likewise.

Reviewed-by: Jakub Jelinek <jakub@redhat.com>
libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/64351.cc
libstdc++-v3/testsuite/26_numerics/random/uniform_real_distribution/operators/gencanon.cc