Sun Studio 12: Fortran User's Guide

3.4.124 –xcrossfile[={1|0}]

Enable optimization and inlining across source files.

Normally, the scope of the compiler’s analysis is limited to each separate file on the command line. For example, -O4’s automatic inlining is limited to subprograms defined and referenced within the same source file.

With -xcrossfile, the compiler analyzes all the files named on the command line as if they had been concatenated into a single source file.

–xcrossfile is only effective when used with -O4 or -O5.

Cross–file inlining creates a possible source file interdependence that would not normally be there. If any file in a set of files compiled together with -xcrossfile is changed, then all files must be recompiled to insure that the new code is properly inlined. See 3.4.48 –inline=[%auto][[,][no%]f1,…[no%]fn].

The default, without -xcrossfile on the command line, is -xcrossfile=0, and no cross-file optimizations are performed. To enable cross-file optimizations, specify -xcrossfile (equivalent to -xcrossfile=1).

Any .s assmbler source files in the compilation do not participate in the crossfile analysis. Also, the -xcrossfile flag is ignored if compiling with -S.