get_d_2exp test failures: clang -emit-llvm/-flto/-O4; icc -ipo/-fast

Niels Möller nisse at
Mon Aug 19 23:22:57 CEST 2013

bathtubdev <bathtubdev at> writes:

> After a bit more digging, I am of the completely inexpert opinion that this
> is neither a compiler/optimizer bug nor a bug in GMP proper. It's a bug in
> the definitions of the mp[f][z]_get_d_2exp functions themselves, as
> inherited from libc.

To me, it definitely sounds like a bug. In either GMP, the test suite,
or the compiler. Results should be independent of compiler optimization

I don't have the time to look into it carefully at the moment, but one
trick that has been used elsewhere in the testsuite is to declare double
variables as volatile. This is a reasonably portable way to drop
extended precision, by forcing the compiler to store the value into
memory, typically in IEEE format. Maybe you could try that; if that
solves the problem, that's an indication it's really a testsuite bug.


Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-bugs mailing list