Sun Studio 12: Fortran User's Guide

3.4.28 –fast

Select options that optimize execution performance.


Note –

This option is defined as a particular selection of other options that is subject to change from one release to another, and between compilers. Also, some of the options selected by -fast might not be available on all platforms. Compile with the -dryrun flag to see the expansion of -fast.


-fast provides high performance for certain benchmark applications. However, the particular choice of options may or may not be appropriate for your application. Use -fast as a good starting point for compiling your application for best performance. But additional tuning may still be required. If your program behaves improperly when compiled with -fast, look closely at the individual options that make up -fast and invoke only those appropriate to your program that preserve correct behavior.

Note also that a program compiled with -fast may show good performance and accurate results with some data sets, but not with others. Avoid compiling with -fast those programs that depend on particular properties of floating-point arithmetic.

Because some of the options selected by -fast have linking implications, if you compile and link in separate steps be sure to link with -fast also.

–fast selects the following options:

It is possible to add or subtract from this list by following the -fast option with other options, as in:

f95 -fast -fsimple=1 -xnolibmopt ...

which overrides the -fsimple=2 option and disables the -xlibmopt selected by -fast.

Because -fast invokes -dalign, -fns, -fsimple=2, programs compiled with -fast can result in nonstandard floating-point arithmetic, nonstandard alignment of data, and nonstandard ordering of expression evaluation. These selections might not be appropriate for most programs.

Note that the set of options selected by the -fast flag can change with each compiler release. Invoking the compiler with -dryrun displays the -fast exapansion:


<sparc>%f95 -dryrun -fast |& grep ###
          ###     command line files and options (expanded):
          ### -dryrun -xO5 -xarch=sparcvis2 -xcache=64/32/4:1024/64/4
              -xchip=ultra3i -xdepend=yes -xpad=local -xvector=lib
              -dalign -fsimple=2 -fns=yes -ftrap=common -xlibmil
              -xlibmopt -fround=nearest