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. See Optimizations for a description of the sorts of optimizations possible.

Many of these controls specify a set of optimizations and some optimization 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)

Builds with
-O0Minimal optimizations (default).
-O

-O1

Optimization level 1.
-O2Optimization level 2.
-O3Optimization level 3.
-OgLess optimizations for better debugging.
-OsSize-orientated optimizations.
-fasmfileOptimizations applied to assembly source files.
-fcacheconstObjects qualified const potentially in RAM.
-f[no-]interrupt-context-loopsLoops being considered when preserving working registers in interrupt context switch code
-flocalLocal optimization set only.
--nofallbackNo longer has any effect and is ignored by the compiler.
-fzeroallram=off|on|autoAll RAM zeroed at startup