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)

LicenseBuilds with
-O0AllNo optimizations (default).
-O1

-O

AllOptimization level 1.
-O2AllOptimization level 2.
-O3PRO onlySpeed-orientated Optimizations.
-OgAllBetter debugging.
-OsPRO onlySize-orientated optimizations.
-f[no-]data-sectionsAllEach data object assigned to its own section.
-f[no-]fat-lto-objectsPRO onlyBoth object code and an internal representation written to the object files.
-f[no-]function-sectionsAllEach function assigned to its own section.
-f[no-]inline-functionsAllIntegration of all simple functions into their callers.
-f[no-]ltoPRO onlyThe standard link-time optimizer.
-flto-partition=algorithmPRO onlyThe specified algorithm to partition object files when running the link-time optimizer.
-f[no-]omit-frame-pointerAllThe stack pointer used in preference to the frame pointer.
-mno-pa-on-file=filenamePROProcedural abstraction disabled for the specified file.
-mno-pa-on-function=functionPROProcedural abstraction disabled for the specified function.
-mno-pa-outline-callsPROProcedural abstraction disabled across function calls.
-f[no-]section-anchorsAllStatic objects accessed relative to one symbol.
-f[no-]unroll-[all-]loopsAllLoops unrolled to improve execution speed.
-f[no-]use-linker-pluginPRO onlyA linker plugin with link-time optimizations.
-f[no-]whole-programPRO onlyThe whole-program optimizations.
-m[no-]gas-isr-prologuesAllOptimized context switch code for small interrupt service routines.
-mpa-callcost-shortcallPRO onlyMore aggressive procedural abstraction.
-mpa-iterations=nPRO onlyThe specified number of procedural abstraction iterations.
--nofallbackAllOnly the selected optimization level and with no license-imposed fall back to a lesser level.