I am using pgf77/pgcc 6.0-5 (64-bit target on x86_64 Linux) on a Xeon system running Red Hat EL4.
I have a 1980’s F77 program that uses some C routines for I/O (it is a graphics library, CGS, used for another, much larger, application). An array is passed between the F77 routines. After a F77 routine calls a C routine,passing the array, the array’s address is set to 0x0. However, the array address is not set to 0x0 after the same F77 routines calls another F77 routine, passing the array.
The value of other local variables or arguments are not changed after calling the C routine.
I can avoid this by using -Msave OR compiling for a 32-bit target. I have the same problem using the Intel F77 and C compilers.
Also, I cannot use -i8 for the F77. Doing so causes the entire application to seg fault — the program’s data structure is explicitly written for 4-byte integers and is nearly 300 files.
My questions are:
– what is it about calling a C routine that causes the F77 routine to “forget” or change the array’s address?
– how can I fix this WITHOUT resorting to the steps mentioned above? (I don’t want to take a performance hit.)
I’ve fixed many of the 32-bit to 64-bit porting issues but I’m nearing my wits-end with this thing.