[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 07:29:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57749
--- Comment #3 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Vittorio Zecca from comment #2)
> I believe -O0 is the default optimization level, so it is important.
>
> Of course the code I sent you is a fragment from a much larger program,
> kind of c**x with c complex and x real. It is not possible to make x
> into an integer.
>
> When x is zero and y is real, x**y is singular for y<=0, right?
I think you are missing the intricacies of complex arithmetics.
x**y = exp (y * log(x)) has an *essential singularity* at x=0,
which is the starting point of a branch cut (usually the negative
real axis). See also cpow(3).
The man page for pow(3) covers only real arithmetics and does not apply.
> Also, I do not understand why I get SIGFPE on either zero or invalid
> -ffpe-trap suboption,
> but this is a lesser issue.
A quick search did not turn up any result whether IEEE specifies
a defined behavior for your case. Maybe you are more successful.
I also could not find anything in the Fortran standard.
More information about the Gcc-bugs
mailing list