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 libfortran/14396] [gfortran] Intrinsic SQRT and CSQRT give wrong answer with COMPLEX argument.


------- 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


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