Pgfortran debugging: problem with print the parameters of a simple function


I am having a problem with debugging a simple fortran 90 example. I have a function with 10 parameters. Both cuda-gdb and gdb prints random values for the parameters after the sixth position (setting a breakpoint inside the function). This does not happen with gfortran.
Here the code:
main.f90 :
program read_write

    integer :: i=1,j=2, k=3, l=4,m=5,n=6,o=7,p=8,q=9,r=10
call function(i,j,k,l,m,n,o,p,q,r)

end program read_write

function.f90 :
subroutine function(a,b,c,d,e,f,g,h,x,y)
implicit none
integer, intent(in) :: a,b,c,d,e,f,g,h,x,y
print *,“line1”
print *,“line2”
print *, a
print *, h
print *, g
end subroutine function

The problem happens when you try to print the variables g, h, x and y with cuda-gdb and gdb.

This is how I compile the code:
pgfortran -g main.f90 function.f90 -o program

Best regards,


1 Like

Thanks for the report Alberto. I’ve filed this as TPR #30998 and sent it to engineering for further investigation.


Hi Alberto,

FYI, TPR #30998 has been fixed in our 22.5 release.


1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.