CodethinkLabs/ofc

Add analysis of COMMON block usage

persia opened this issue · 2 comments

In issue #14 , it is mentioned that COMMON and EQUIVALANCE blocks in Fortran complicate the export of an SSA tree.

On the Fortran COMMON/EQUIVALENCE issue, there exists a (light, wrapper) script that runs the Sun f90 compiler with the -Xlist flag. That flag gives, for each parsed file, a listing of what COMMON blocks are used, the offset into that block, and, if the usage is via an EQUIVALENCE, what the nominal reference is. The tool is Sun-only, but is very nice.

Could OFC output similar information?

We can output the COMMON block usage relatively easily, we can't output byte offsets since we're not yet compiling.

A basic form of COMMON block usage has been added using the flag "--common-usage", it shows all COMMON block entries that are used in a file list.
It doesn't currently list indirect uses by EQUIVALENCE because that basically requires a memory map to do, because we'd need to know if array offsets reside inside a common block.