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/25017] sqrt, csqrt may give a wrong result if real part of compex argument is zero



------- Comment #9 from harald dot vogt at desy dot de  2005-11-30 16:17 -------
(In reply to comment #8)
> Subject: Re:  csqrtf, csqrt, csqrtl
> 
> Do you have a patch?  Because I have no idea want you
> mean.  libgfortran/configure already checks for the existence
> of these functions.   glibc's are broken in the release,
> but are fixed in cvs.
> 

After patching libgfortran/configure the code of
libgfortran/intrinsics/c99_functions.c was used. But this code has still a
problem seen with the following fortran code
      program test
      complex cres1, cres2
      cres1 = -(4,0)
      cres2 = sqrt(cres1)
      print*,'cres1=',cres1, 'cres2=',cres2
      cres1 = (-4,0)
      cres2 = sqrt(cres1)
      print*,'cres1=',cres1, 'cres2=',cres2
      end

This requires also corrections in libgfortran/intrinsics/c99_functions.c .
The patches I have made compared to gcc-rev-107187 from gcc's SVN you will find
here:
http://www-zeuthen.desy.de/~hvogt/gfortran/configure.ac.diff
http://www-zeuthen.desy.de/~hvogt/gfortran/acinclude.m4.diff
http://www-zeuthen.desy.de/~hvogt/gfortran/configure.diff
http://www-zeuthen.desy.de/~hvogt/gfortran/config.h.in.diff
http://www-zeuthen.desy.de/~hvogt/gfortran/c99_functions.c.diff


-- 


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


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