[Bug middle-end/57974] std::pow(std::complex<long double>(0),1) returns (-nan,-nan)
ubizjak at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jul 25 15:58:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57974
--- Comment #6 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Paolo Carlini from comment #5)
> But isn't this a bug? I mean, naively, what do we gain from the optimization
> point of view from not evaluating as 0 in any case? And why it happens only
> for long double?
Because long double always goes through x87. doubles and floats will fail your
test with -m32 or -mfpmath=387 in addition to -funsafe-math-optimizations.
BTW: The test does use infinty (which is IEEE thingy), and there is explicit
warning that -funsafe-math-optimizations will violate these rules.
More information about the Gcc-bugs
mailing list