http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60637
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> --- IIUC (with gcc-4.9), signbit is not part of C++98, and with -std=c++11 things work. In C++98 mode, libstdc++ (sometimes) provides std::signbit as an extension, which calls __builtin_signbit which takes a double as argument; the conversion yields -infinity, which with -ffast-math is undefined behavior. I don't know the history of why libstdc++ provides non-standard functions in namespace std, but since it does, it should probably use the same code as C++11, or at least add 'l' after __builtin_signbit (use the safest of the 3 versions).