4.6.6 Options for Controlling Optimization

The options shown in the table below control compiler optimizations and are described in the sections that follow. The table also indicates whether a compiler license is required to select the optimization level. See Optimizations for a description of the sorts of optimizations possible.

Many of these controls specify a set of optimizations and that some sets disable certain optimizations, thus a ‘select all options’ approach will not produce the most compact output.

Table 4-24. General Optimization Options
Option

(links to explanatory section)

LicenseBuilds with
-O0NoMinimal optimizations (default).
-O

-O1

NoOptimization level 1.
-O2NoOptimization level 2.
-O3YesOptimization level 3.
-OgNoLess optimizations for better debugging.
-OsYesSize-orientated optimizations.
-fasmfileNoOptimizations applied to assembly source files.
-fcacheconstYesObjects qualified const potentially in RAM.
-flocalNoLocal optimization set only.
--nofallbackNoOnly the selected optimization level and with no license-imposed fall back to a lesser level.