This is the mail archive of the gcc-patches@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]

Re: [Patch,Fortran] PR33197 (F2008) Add complex tan/cosh/sinh/cosh


On Thu, Jul 09, 2009 at 09:08:16PM +0200, Tobias Burnus wrote:
> Hi all,
> 
> as Kaveh pointed out: The complex trigonometric
> functions tan, sinh, cosh and tanh are supported by
> MPC and libgfortran has the C99 fallback functions
> implemented. Thus one can simply enable them,
> what this patch does.
> 
> I have not added the compile-time simplification
> via MPC - leaving this to a later patch by Kaveh,
> me or someone else.
> 
> Build and regtested on x86-64-linux.
> OK for the trunk?
> 

FX said he had a small amount of time to look into 
implementing these functions.  Perhaps, he'll do the
simplification.

It appears that the c99_function.c fallback functions 
need some scrutiny.  Your complex_intrinsic_3.f90
fails on FreeBSD.  A quick scan of c99_functions.c
finds 

ccoshf (float complex a)
{
  float r, i;
  float complex v;

  r = REALPART (a);
  i = IMAGPART (a);
  COMPLEX_ASSIGN (v, coshf (r) * cosf (i), - (sinhf (r) * sinf (i)));
  return v;
}

The sign of the imaginary part is wrong.  It should be +.
Likewise, in ccosh and ccoshl.

-- 
Steve


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