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/62188] Array bounds overrun in bessel_yn_r4/8/16 and other functions


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

--- Comment #10 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Tue, Aug 26, 2014 at 07:51:45AM -0700, Steve Kargl wrote:
> On Tue, Aug 26, 2014 at 01:08:22PM +0000, burnus at gcc dot gnu.org wrote:
> > 
> > Steve, should we also add a test case for the "n1 < 0"?
> > 
> 

Checking in general looks broken for bessel_yn and probably _jn.

program neumann_test
   implicit none
   integer n1, n2
   real x, b(10)
   x = 42.
   b = bessel_yn(-5, x)
   n1 = -5
   n2 = 5
   b = bessel_yn(n1, n2, x)
!  b = bessel_yn(-5, n2, x)
end program neumann_test

troutmask:sgk[223] gfc5x -o z bes.f90
troutmask:sgk[224] gfc5x -o z -std=f2008 bes.f90
bes.f90:8.17:

   b = bessel_yn(-5, x)
                 1
Error: GNU Extension: Negative argument N at (1)

First, this GNU Extension should not exists as bessel_[jy]n are
new in F2008 and I think we should adhere to the standard.

Second, umcommenting he last line in the program 
yields

bes.f90:12.7:

   b = bessel_yn(-5, n2, x)
       1
Error: Too many arguments in call to 'bessel_yn' at (1)

So, it appears the wrong checking function is getting called.
It may take me a day or 2 to unravel the issue.


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