This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/57749] -ffpe-trap=zero or invalid produces SIGFPE on complex zero ** 1e0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57749

--- Comment #4 from Vittorio Zecca <zeccav at gmail dot com> ---
I am happy to refresh my complex analysis study of long ago.
The singularity of log(x) in zero is not essential.
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.
Anyway I am not sure this is an essential (forgive the pun) reason to raise
an exception

Also I do not understand the different behaviour with different levels of
optimization,
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.


2013/6/29 anlauf at gmx dot de <gcc-bugzilla@gcc.gnu.org>

> 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.
>
> --
> You are receiving this mail because:
> You reported the bug.
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]