C++ User's Guide

-fast

Optimizes for speed of execution using a selection of options.

This option is a macro that selects a combination of compilation options for optimum execution speed.

The criteria for the -fast option vary with the C, C++, FORTRAN 77, and Pascal compilers. See the appropriate compiler documentation for specifics.

Expansions

This option provides near maximum performance for many applications by expanding to the following compilation options:

Option 

SPARC 

x86 

 

-dalign

 

-fns

 

-fsimple

 

-ftrap=%none

 

-nofstore

 

-xlibmil

 

-xlibmopt

 

-xO4

 

-xtarget=native

 

Interactions

The -fast option expands into options that may affect options that are specified after -fast.

The code generation option, optimization level, and use of inline template files can be overridden by subsequent options. The optimization level that you specify overrides a previously set optimization level.

The -fast option includes -fns -ftrap=%none; that is, this option turns off all trapping.

Examples

The following compiler command results in an optimization level of -xO3:

demo% CC -fast -xO3

The following compiler command results in an optimization level of -xO4:

demo% CC -xO3 -fast

Warnings

Do not use this option for programs that depend on IEEE standard floating-point arithmetic; different numerical results, premature program termination, or unexpected SIGFPE signals can occur.


Note -

In previous SPARC releases, the -fast macro option included -fnonstd; now it does not. Nonstandard floating-point mode is not initialized by -fast. See the Numerical Computation Guide, ieee_sun(3M).


See also

-dalign, -fns, -fsimple, -ftrap=%none, -libmil, -nofstore, -xO4, -xlibmopt, -xtarget=native