I have inherited a code that has a lot of poor coding techniques. In the ~50,000 lines of FORTRAN there is a significant amount of code that can never be reached. In older mainframe compilers (e.g., FTN for CDC machines) the compiler cross-reference map would help to find such coding problems. Is there a way to use Intel's compiler to find such problems?
The key is to distinguish between truly dead code and code that may be dead most of the time but, for certain input data, may be executed. The compiler and the linker are pretty good at removing dead code from the EXE. However, if you want to prune the source code itself, you can run the static analysis tool (not supplied with the Composer editions) on the source code or use Amplifier to profile your source code in one or more runs.
The compiler does generate a cross-reference listing for each program unit, if you ask it to. Similarly, the linker can produce a map.
There are third party tools that specialize in such tasks, such as SPAG and Forcheck.
We have found code that is truly dead, but not given a proper funeral. We are sure there is a lot more of the same.
I have looked for the ability to generate a cross-reference map (variables and labels) but have not found it. Can you direct me to the proper option to invoke?
I will check into the static analysis tool and the third party tools. Thanks.
The /list option outputs a listing file (.lst) with a line-numbered listing, followed by a list of labels and references, a list of variables and references, and finally a list of the compiler options in effect. I do not remember the exact version of Ifort in which cross-reference lists were made available, but I remember some threads in which Dr. Fortran announced that it was in the works.