3.6.6 Options for Controlling Optimization

The options tabulated below control compiler optimizations and are described in the sections that follow.

Table 3-16. General Optimization Options
Option

(links to explanatory section)

License Builds with
-O0 All No optimizations (default)
-O1

-O

All Optimization level 1
-O2 All Optimization level 2
-O3 PRO only Speed-orientated Optimizations
-Og All Better debugging
-Os PRO only Size-orientated optimizations
-f[no-]data-sections All Each data object assigned to its own section
-f[no-]fat-lto-objects PRO only Both object code and an internal representation written to the object files
-f[no-]function-sections All Each function assigned to its own section
-f[no-]lto PRO only The standard link-time optimizer
-flto-partition=algorithm PRO only The specified algorithm to partition object files when running the link-time optimizer
-f[no-]omit-frame-pointer All The stack pointer used in preference to the frame pointer
-mno-pa-on-file=filename PRO Procedural abstraction disabled for the specified file
-mno-pa-on-function=function PRO Procedural abstraction disabled for the specified function
-mno-pa-outline-calls PRO Procedural abstraction disabled across function calls
-f[no-]section-anchors All Static objects accessed relative to one symbol
-f[no-]unroll-[all-]loops All Loops unrolled to improve execution speed
-f[no-]use-linker-plugin PRO only A linker plugin with link-time optimizations
-f[no-]whole-program PRO only The whole-program optimizations
-m[no-]gas-isr-prologues All Optimized context switch code for small interrupt service routines
-mpa-callcost-shortcall PRO only More aggressive procedural abstraction
-mpa-iterations=n PRO only The specified number of proceedural abstraction iterations
--nofallback All Only the selected optimization level and with no license-imposed fall back to a lesser level