http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50880
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|wrong-code | CC| |g...@integrable-solutions.ne | |t --- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-10-27 09:24:26 UTC --- Thus, to understand and clarify why this has not been noticed so far, you are on a target which doesn't support in the underlying C library these complex functions, right? Because normally (eg, on Linux) these days we just forward to __builtin_cacosh*, the code you are touching is just a "surrogate", a "fallback", which doesn't get right all the special cases, NaNs, infinity. Anyway, a similar tweak would touch also the C++11 version in std:: Gaby, can you have a look to this, double check the patch? For your convenience the surrounding code is: template<typename _Tp> std::complex<_Tp> __complex_acosh(const std::complex<_Tp>& __z) { std::complex<_Tp> __t((__z.real() - __z.imag()) * (__z.real() + __z.imag()) - _Tp(1.0), _Tp(2.0) * __z.real() * __z.imag()); __t = std::sqrt(__t); return std::log(__t + __z); }