This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/57974] std::pow(std::complex<long double>(0),1) returns (-nan,-nan)
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Jul 2013 13:23:14 +0000
- Subject: [Bug middle-end/57974] std::pow(std::complex<long double>(0),1) returns (-nan,-nan)
- Auto-submitted: auto-generated
- References: <bug-57974-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57974
--- Comment #18 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Couple of clarifications: this doesn't go through cpow at all, the second
argument isn't complex; this isn't -ffast-math, and in general in my experience
whatever you throw at clang and icc (in fact, clang++ accepts the very same -f
gcc accepts) like -Ofast, it never happens that exp(-inf) becomes nan (now I
don't have the time to actually run benchmarks but since we are talking about
compile-time constants I don't think we are beating them performance-wise on
this); why long double is so special for exp(-inf), I don't think we can make a
case for that, in terms of consistency or x87 crazyness (we are comparing also
to icc not to a random compiler from people not really knowing the
architecture).
But sorry I'm not going to contribute much more to this discussion, at the
moment I don't think I'm able to make the compiler concretely better and it
only would make me nervous.