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 #9 from Vittorio Zecca <zeccav at gmail dot com> ---
Yes, I agree that there is a bug, and IMO it is in cpow/cpowf/cpowl.
With -ffpe-trap=invalid,zero,
as I wrote earlier, complex zero**I where I is integer equal to one,
does not raise
any exception and delivers the expected (by me) result, zero.
Complex zero**X where X is real equal to one raises exception.
Complex zero**C where C is complex equal to (1e0,0e0) raises exception.
This is because glibc computes x**y as exp(y*log(x)) so it fails when x=0,
but IMO it should not compute log(x) if x=0 and y>0 (y real),
it should take a shortcut instead and deliver complex zero.


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