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>
// { dg-do run { target { c++11 && { ! simulator } } } }
// { dg-require-cstdint "" }
+// { dg-additional-options -fexcess-precision=standard }
#include <random>
#include <testsuite_hooks.h>
// { dg-do run { target { c++11 && { ! simulator } } } }
// { dg-skip-if "requires new impl" { *-*-* } { -D_GLIBCXX_USE_OLD_GENERATE_CANONICAL -D_GLIBCXX_USE_OLD_GENERATE_CANONICAL=1 } }
+// { dg-additional-options -fexcess-precision=standard }
#include <random>
#include <limits>