https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121366

Harald Anlauf <anlauf at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #8 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
Created attachment 64677
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64677&action=edit
Partial patch

This fixes the naming issue for me, in the sense that it links.

However, I get wrong results when using funptr => sind.

I suspect a wrong prototype for sind.

Example:

  print *, sin(x) + sind(x)

compiles to

  y = __builtin_sinf (x) + _gfortran_sind_r4 (x);

The prototype of sinf is in c99_protos.h:

extern float sinf(float);

But I do not see a prototype for _gfortran_sind_r4, it is buried somewhere.
(The above evalutates fine, though.)

However, with a funptr:

program test
  implicit none
  interface
     function func(x)
       real              :: func
       real, intent (in) :: x
     end function func
  end interface

  real :: x = 45., y

  procedure(func) ,pointer :: f1 => sin
  procedure(func) ,pointer :: f2 => sind

  y = f1(x) + f2(x)
end

This produces:

  real(kind=4) y;
  static real(kind=4) (*<T691>) (real(kind=4) & restrict) f1 =
_gfortran_specific__sin_r4;
  static real(kind=4) (*<T691>) (real(kind=4) & restrict) f2 =
_gfortran_sind_r4;

  y = f1 (&x) + f2 (&x);

Note that _gfortran_specific__sin_r4 uses pass by reference.

So what is _gfortran_sind_r4 ?

Reply via email to