https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95329
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I believe this is a glibc bug rather than gcc. This is without optimizations and the library function in libm is called in both cases and giving different results based on whether it is -inf, nan(0x2cba7e) or -inf, nan(0x400000). glibc has a different bug tracker though, so you need to file it there (sourceware.org/bugzilla). If you compile with -O2, you'll get -inf in both cases (in that case no library call is done and it is folded by gcc).