[Bug target/95450] [10/11 regression] Wrong long double folding

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Aug 11 16:19:04 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95450

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The problem is that this gl_LDBL_MAX.ld is really the right maximum normalized
double double number, but is one ulp larger than GCC's __LDBL_MAX__.
The former is:
0x1.fffffffffffff7ffffffffffffc000p+1023
and the latter is:
0x1.fffffffffffff7ffffffffffff8000p+1023
The reason why gcc doesn't like the former and will treat it as infinity is
that
GCC internally treats the double double as having a 106 bit precision, but the
former number is too large for 106 bit precision, it requires 107 bit
precision.
If we'd want to handle double double "properly" in GCC, we'd need to emulate it
the way it is actually implemented, as a pair of doubles, and have all the
operations defined for those (the question is what to do for transcendentals
etc.), by recursing on real_* operations on both doubles.


More information about the Gcc-bugs mailing list