mpn/t_get_d test failure with '-O3 -ffast-math'

Marc Glisse marc.glisse at inria.fr
Sun Jul 13 13:58:07 CEST 2025


Hello,

thanks for the report.

On Fri, 11 Jul 2025, Vasili Burdo wrote:

> mpn_get_d wrong, didn't get infinity

-ffast-math implies -ffinite-math-only, so of course anything dealing with 
infinities is likely to break.

> - disallow gmplib building w/ -ffast-math.

That's the default for any software that does not explicitly document that 
they support -ffast-math (with a specific version of a specific compiler). 
-ffast-math means that floating point operations are allowed to produce 
arbitrary nonsense and makes the compiler non-conforming.

> - workaround mpn_gmp_d() somehow in case of aggressive FP optimizations.

That might be possible, but it does not seem worth the trouble.

-- 
Marc Glisse


More information about the gmp-bugs mailing list