[Bug fortran/57749] -ffpe-trap=zero or invalid produces SIGFPE on complex zero ** 1e0
anlauf at gmx dot de
gcc-bugzilla@gcc.gnu.org
Sat Jun 29 12:02:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57749
--- Comment #5 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Vittorio Zecca from comment #4)
> I am happy to refresh my complex analysis study of long ago.
> The singularity of log(x) in zero is not essential.
Right.
> Essential singularity means the Laurent seriesis infinite in both
> directions?
> z**-k and z**+k roughly, but log(z) Laurent series is infinite only for
> z**+k.
> I hope to remember correctly.
> But exp(y*log(x)) may well be essential, however.
Yes, since exp(z) has an essential singularity at complex infinity.
> Anyway I am not sure this is an essential (forgive the pun) reason to raise
> an exception
So what should the correct result be?
> Also I do not understand the different behaviour with different levels of
> optimization,
I think that compile-time optimization realizes that the exponent y
is actually exactly a positive integer and does some simplification.
At -O0, you get an evaluation by the run-time library.
> and I confirm the a.out executable runs fine under valgrind.
> And the code runs fine with Intel ifort.
> And I really do not see how complex zero raised to a positive power should
> raise an exception.
Well, you actually provide a non-integer (real or complex) exponent,
even if it is accidentally a positive integer.
More information about the Gcc-bugs
mailing list