3.6.6 Options for Controlling Optimization

The options listed below control compiler optimizations and are described in following sections.

Table 3-16. General Optimization Options
Option

(links to explanatory section)

Builds with
-O0No optimizations (default).
-O1

-O

Optimization level 1.
-O2Optimization level 2.
-O3Speed-orientated Optimizations.
-OgBetter debugging.
-OsSize-orientated optimizations.
-f[no-]data-sectionsEach data object assigned to its own section.
-f[no-]fat-lto-objectsBoth object code and an internal representation written to the object files.
-f[no-]function-sectionsEach function assigned to its own section.
-m[no-]gas-isr-prologuesOptimized context switch code for small interrupt service routines.
-f[no-]inline-functionsIntegration of all simple functions into their callers.
-f[no-]ltoThe standard link-time optimizer.
-flto-partition=algorithmThe specified algorithm to partition object files when running the link-time optimizer.
-f[no-]omit-frame-pointerThe stack pointer used in preference to the frame pointer.
--nofallbackNo longer has any effect and is ignored by the compiler.
-mno-pa-on-file=filenameProcedural abstraction disabled for the specified file.
-mno-pa-on-function=functionProcedural abstraction disabled for the specified function.
-mno-pa-outline-callsProcedural abstraction disabled across function calls.
-m[no-]paProcedural abstraction.
-mpa-callcost-shortcallMore aggressive procedural abstraction.
-mpa-iterations=nThe specified number of procedural abstraction iterations.
-m[no-]reorder-stack-varsReordered stack objects in the local frame.
-f[no-]section-anchorsStatic objects accessed relative to one symbol.
-f[no-]unroll-[all-]loopsLoops unrolled to improve execution speed.
-f[no-]use-linker-pluginA linker plugin with link-time optimizations.
-f[no-]whole-programThe whole-program optimizations.