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

fortran/3807: Function BESJN(integer,double) problems



>Number:         3807
>Category:       fortran
>Synopsis:       Function BESJN(integer,double) problems
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 24 23:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     David Billinghurst
>Release:        gcc 2.95 and 3.1
>Organization:
>Environment:
mips-sgi-irix6.5 and i686-pc-cygwin
>Description:
While working on tests for Bessel functions, I found some problems with intrinsic functions BESJN and BESYN.  I am not sure it they are bugs or documentation issues.

g77 is upset about the return type of BESJN(i,x) for double precision x.  The documentation indicates that the return type is that of the second argument d.  

The source, in intrin.def agrees, with 
DEFIMP	(BESJN,"BESJN",L_BESJN,,,"R=:1:N=I*,X=R*")

Have a look at the tests commented out in g77.f-torture/execute/intrinsic-unix-bessel.f for the full set of problems.
One case is:

c From g77.f-torture/execute/intrinsic-unix-bessel.f
c
c     David Billinghurst <David.Billinghurst@riotinto.com>
c
      double precision dx, da
      dx = 2.0d0
      da = 0.3528340d0
      call c_d(BESJN(2,dx),da)
      end

      subroutine c_d(a,b)
      double precision a, b
      if ( abs(a-b) .gt. 1.0d-5 ) then
         write(6,*) 'a = ', a
         write(6,*) 'b = ', b
         call abort
      end if
      end

When compiled on mips-sgi-irix6.5

g77 -Wall -o bug1 bug1.f
bug1.f: In subroutine `c_d':
bug1.f:8: warning:
         call c_d(BESJN(2,dx),da)
              1
bug1.f:11: (continued):
         subroutine c_d(a,b)
                    2
Argument #1 (named `a') of `c_d' is one precision at (2) but is some other precision at (1) [info -f g77 M GLOBALS]


and when run

./bug1
 a =   1.23089654E-06
 b =   0.352834
Fortran abort routine called
Abort (core dumped)

>How-To-Repeat:
Run the test case above
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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