I get a run-time segmentation fault on an integer assignment statement (np=some_integer, or even np=1) in a fortran 77 subroutine. I compiled the code using:
pgf90 -Mbounds -Mpreprocess -g -O0
The code is made of Fortran 77 and Fortran 90 subroutines/modules. This subroutine works perfectly fine when used in another plain Fortran 77 code compiled with pgf90.
I get a SIGSEGV when the code executes np=92. np is an integer in a common block. np is unassigned before the line np=92, therefore its value is -1869573949 when I print it in pgdbg.
My best guess is that something is stomping over np’s memory reference but without more information I can’t be sure. Although -Mbounds isn’t finding it, are you writing beyond the end our an array in your common block?
I assume the -Mbounds flag should not allow writings out of array bounds. I have more than one common block. I increased the size of the arrays in the common block where the variable np is by a factor 7 (so that they are 7 times bigger than needed), but the problem still occurs.
Yes, -Mbounds is supposed to check if the array goes out of bound. Which PGI compiler version do you use? Is it possible to provide us a test case? You can post it here or send to trs@pgroup.com.