3.6.6 Options for Controlling Optimization
The options listed below control compiler optimizations and are described in following sections.
| Option (links to explanatory section) | Builds with |
|---|---|
-O0 | No optimizations (default). |
-O1
| Optimization level 1. |
-O2 | Optimization level 2. |
-O3 | Speed-orientated Optimizations. |
-Og | Better debugging. |
-Os | Size-orientated optimizations. |
-f[no-]data-sections | Each data object assigned to its own section. |
-f[no-]fat-lto-objects | Both object code and an internal representation written to the object files. |
-f[no-]function-sections | Each function assigned to its own section. |
-m[no-]gas-isr-prologues | Optimized context switch code for small interrupt service routines. |
-f[no-]inline-functions | Integration of all simple functions into their callers. |
-f[no-]lto | The standard link-time optimizer. |
-flto-partition=algorithm | The specified algorithm to partition object files when running the link-time optimizer. |
-f[no-]omit-frame-pointer | The stack pointer used in preference to the frame pointer. |
--nofallback | No longer has any effect and is ignored by the compiler. |
-mno-pa-on-file=filename | Procedural abstraction disabled for the specified file. |
-mno-pa-on-function=function | Procedural abstraction disabled for the specified function. |
-mno-pa-outline-calls | Procedural abstraction disabled across function calls. |
-m[no-]pa | Procedural abstraction. |
-mpa-callcost-shortcall | More aggressive procedural abstraction. |
-mpa-iterations=n | The specified number of procedural abstraction iterations. |
-m[no-]reorder-stack-vars | Reordered stack objects in the local frame. |
-f[no-]section-anchors | Static objects accessed relative to one symbol. |
-f[no-]unroll-[all-]loops | Loops unrolled to improve execution speed. |
-f[no-]use-linker-plugin | A linker plugin with link-time optimizations. |
-f[no-]whole-program | The whole-program optimizations. |
