https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118038
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Gero from comment #5) > Hello Andrew, > Thanks for your answers. However, I don't understand exactly what this has > to do with PR 104522. So this is an internal to GCC issue. ... > bit_cast should only do the bit conversion and not worry about other > sensitivities. Whether the results are useful or not should not be of > interest at this point. This is in the hands of the caller. Not exactly because internal to GCC has to be able to handle constant folding of the bit_cast. In this case the oddness of the x87 float 80bit formats have to be exposed internally to GCC which GCC decides to punt on some of them because it does not handle "record pseudo denormals, pseudo infinities, pseudo NaNs and unnormal values". In this case it is a `pseudo NaNs` which GCC does not know how to represent internally. GCC only knows how to reprsent normalized NaNs and such. This is just an odity of the x87 float 80bit format that there are NaNs (infs and a few other things) which are not exactly similar enough to the IEEE format. There are a few other FPU formats that have a similar issue too (IBM's double double for an example) where internally GCC does not have a representation of all of the values that the format handles. These odd formats are becoming rarer and less likely to be used by users which is why there has not been much effect put in to fixing this.