This option specifies the level of optimization to be used when compiling source files.
of the following:
Minimum optimization. Turns off most optimizations. It gives the best possible debug view and the lowest level of optimization.
Restricted optimization. Removes unused inline functions and unused static functions. Turns off optimizations that seriously degrade the debug view. If used with
--debug, this option gives a satisfactory debug view with good code density.
High optimization. If used with
--debug, the debug view might be less satisfactory because the mapping of object code to source code is not always clear.
This is the default optimization level.
-O3performs the same optimizations as
-O2however the balance between space and time optimizations in the generated code is more heavily weighted towards space or time compared with
-O2. That is:
-O3 -Otimeaims to produce faster code than
-O2 -Otime, at the risk of increasing your image size
-O3 -Ospaceaims to produce smaller code than
-O2 -Ospace, but performance might be degraded.
-O3performs extra optimizations that are more aggressive, such as:
High-level scalar optimizations, including loop unrolling, for
-Otime. This can give significant performance benefits at a small code size cost, but at the risk of a longer build time.
More aggressive inlining and automatic inlining for
The performance of floating-point code can be influenced by
selecting an appropriate numerical model using the
Do not rely on the implementation details of these optimizations, because they might change in future releases.