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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #10 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-14 
13:39:29 UTC ---
(In reply to comment #8)
> It looks like gsl_poly_dd_taylor overwrites part of the caller's stack frame.
> Specifically, this statement
>   w[size - 1] = 1.0;
> appears to go out of bounds. Can someone who understands Fortran check the
> source whether it's actually valid?

Well, in this example "size" is 3, hence, w[size -1] == w[2]. In Fortran, the
"w" is the last argument, which is 2 and thus "d(2)" == "d(1:2)" has two
elements. And indeed, accessing w[2] is a bit dangerous if one has just two
elements ...

I think you are right that it is invalid, even if it appeared to work
flawlessly and without valgrind errors with other compilers (gfortran 4.5, g95,
ifort, NAG, ...).

Sorry for not being able to debug properly at 2 a.m. And thanks for checking!

Close as INVALID.

Reply via email to