I could really use some suggestions in helping track down a
terrible bug. The code produces a segment violation that
occurs, according to decladebug, in the "prologue" code of
a module procedure (stuff before the first actual f90 statement).
The relevent bits of F90 code are
real(kind=r8), dimension(:,:), allocatable :: x
real(kind=r8), dimension(:), allocatable :: fc
... !! x and fc are allocated and initialized
x = PolynomialFilter (x, fc)
(I've checked that the actual arguments are good.) and
function PolynomialFilter( x, f ) result( y )
real(kind=r8), dimension(:,:), intent(in) :: x
real(kind=r8), dimension(0:), intent(in) :: f
real(kind=r8), dimension(size(x,dim=1),size(x,dim=2)) :: y
real(kind=r8), dimension(:,:), pointer :: y0, y1, y2, yt
real(kind=r8), dimension(size(x,dim=1),size(x,dim=2),3), target :: work
It's clear from the array result and automatic array that
the compiler must generate a fair amount of code before it
even encounters the first executable f90 statement. I've
managed to track down the specific machine instruction where
the code dies, however there aren't enough clues in the
assembly listing (-V -show code) to allow me -- I'm on very
thin ice when it comes to reading assembly -- to connect the
assembly with specific initialization tasks, such as the
size computations or array allocations.
Have I overlooked some option or directive that will dump
more informatation to the assembly listing?
I am seeing one fishy thing happen in the procedure prologue.
Stepping through with decladebug I see
stopped at [...] ldq r17, -30264(gp)
^^^^^^
whereas the corresponding line in the assembly listing is
... ldq r17, var$0018 # r17, 40(gp)
^^
I see this perhaps 10 times before hitting the seg fault.
Thanks for any suggestions you can offer.
------------------------------------------------------------------------
Neil N. Carlson [log in to unmask] (work)
T-1, MS B221 [log in to unmask] (non-work)
Los Alamos National Laboratory 505-665-1220 (voice)
Los Alamos, NM 87545 505-665-5757 (fax)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|