Options for Controlling Optimization

The options shown in Table 4-23 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.

Note that some selections disable optimizations, thus a ‘select all options’ approach will not produce the most compact output.

Table 1. General Optimization Options
Option License Builds with
-O0 No Minimal optimizations (default)
-O

-O1

No Optimization level 1
-O2 No Optimization level 2
-O3 Yes Optimization level 3
-Og No Less optimizations for better debugging
-Os Yes Size-orientated optimizations
-fasmfile No Optimizations applied to assembly source files
-f[no-]local No Local optimizations
--nofallback No Only the selected optimization level and with no license-imposed fall back to a lesser level