This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/14396] [gfortran] Intrinsic SQRT and CSQRT give wrong answer with COMPLEX argument.
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Mar 2004 04:14:45 -0000
- Subject: [Bug libfortran/14396] [gfortran] Intrinsic SQRT and CSQRT give wrong answer with COMPLEX argument.
- References: <20040303044155.14396.bdavis9659@comcast.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-06 04:14 -------
The problem comes from libgfortran's csqrt which is not used always (for targets with C99 math
functions it is not used at all, I do not have a list of targets which have C99 math functions and which
do not):
>From bud davis:
/* sqrt(z). Algorithm pulled from glibc. */
GFC_COMPLEX_4
csqrtf (GFC_COMPLEX_4 z)
{
GFC_REAL_4 re;
GFC_REAL_4 im;
GFC_COMPLEX_4 v;
re = REALPART (re); <--- should be z
im = IMAGPART (im); <--- should be z
--
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Component|fortran |libfortran
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-03-06 04:14:44
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14396