Compiler options: "-Msave" and "-fast"

Dear All:

I’m trying to compile a Fortran source file with optimization and saving local variables. However, it is likely that the file isn’t compiled correctly.

When I use a GNU g77 compiler, the compilation went well. In g77, “-fno-automatic” and “-O” options were used. While in pgf77, I used “-Msave” and “-fast” options. When I executed a compiled executable file, it was aborted.

Are “-fno-automatic” and “-O” options in GNU equivalent to “-Msave” and “-fast” in PGI, respectively?

I’d appreciate any suggestions and comments.

Thank you,

Toki

Hi Toki,

The pgf77 “-Msave” tells the compiler to assume that all local variables have the “SAVE” attribute. I believe the g77 flag “-fno-automatic” does this as well so “-Msave” would be equivlent. However, “-fast” is a more agressive optimization than g77’s “-O”. Our equivlent would be “-O” or “-O2”.

Have you been able to determine why the program aborts? Is it an internal program error or is it caused by a hardware fault (segmetation violation, bus error, stack overflow, floating-point exceptions, etc.)? If you don’t know, try compiling with “-g -Msave” and run your program in the PGI debugger, pgdbg.

  • Mat