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 5.13 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.
Option (links to explanatory section) |
License | Builds with |
---|---|---|
-O0 |
No | Minimal optimizations (default). |
-O
|
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. |
-fcacheconst |
Yes | Objects qualified const potentially in
RAM. |
-flocal |
No | Local optimization set only. |
--nofallback |
No | Only the selected optimization level and with no license-imposed fall back to a lesser level. |