Select floating-point optimization preferences.
SPARC: 77/90 x86:77
Allow the optimizer to make simplifying assumptions concerning floating-point arithmetic. (See the Floating-Point Arithmetic chapter of the Fortran Programming Guide.)
For consistent results, compile all units of a program with the same -fsimple option.
If n is present, it must be 0, 1, or 2. The defaults are:
Without the -fsimple flag, the compiler defaults to -fsimple=0
With -fsimple alone, the compiler defaults to -fsimple=1
The different floating-point simplification levels are:
-fsimple=0
Permit no simplifying assumptions. Preserve strict IEEE 754 conformance.
-fsimple=1
Allow conservative simplifications. The resulting code does not strictly conform to IEEE 754, but numeric results of most programs are unchanged.
With -fsimple=1, the optimizer can assume the following:
IEEE 754 default rounding/trapping modes do not change after process initialization.
Computations producing no visible result other than potential floating point exceptions may be deleted.
Computations with Infinity or NaNs ("Not a Number") as operands need not propagate NaNs to their results; e.g., x*0 may be replaced by 0.
Computations do not depend on sign of zero.
With -fsimple=1, the optimizer is not allowed to optimize completely without regard to roundoff or exceptions. In particular, a floating-point computation cannot be replaced by one that produces different results with rounding modes held constant at run time. -fast includes -fsimple=1.
-fsimple=2
Permit aggressive floating point optimizations that may cause many programs to produce different numeric results due to changes in rounding.
For example, -fsimple=2 permits the optimizer to attempt to replace repeated computations of x/y with x*z, where z=1/y is computed once and saved in a temporary, eliminating the costly divide operation.
Even with -fsimple=2, the optimizer still is not permitted to introduce a floating point exception in a program that otherwise produces none.