[PATCH 3/3] libstdc++: Use -fexcess-precision=standard for std::generate_canonical tests

Jakub Jelinek jakub@redhat.com
Wed Dec 17 20:27:00 GMT 2025


On Wed, Dec 17, 2025 at 07:50:17PM +0000, Jonathan Wakely wrote:
> 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.

LGTM.

	Jakub



More information about the Libstdc++ mailing list