ARM Proposes Changing GCC's Default Optimization Level To -Og
Written by Michael Larabel in GNU on 26 October 2017 at 01:46 PM EDT. 15 Comments
GNU --
The GNU Compiler Collection currently uses -O0 as the default optimization level when no other optimization level is passed. An ARM developer is proposing the default optimization level be changed to -Og.

Wilco Dijkstra of ARM argues, "Unfortunately unlike other compilers, GCC generates extremely inefficient code with -O0. It is almost unusable for low-level debugging or manual inspection of generated code. So a -O option is always required for compilation. -Og not only allows for fast compilation, but also produces code that is efficient, readable as well as debuggable. Therefore -Og makes for a much better default setting."

The -O0 level doesn't enable any optimizations to reduce compilation time and when debugging allow for expected results. The -Og optimization level is intended for an optimized debugging experience but does enable "a reasonable level of optimization" while balancing the compilation speed and debugging experience. It enables basic performance optimizations and tends to perform better than -O0 in our own C/C++ benchmarks.

GCC's current optimization levels are documented via

The change is currently sitting on gcc-patches while awaiting feedback from other developers for deciding whether to go ahead and change the default optimization level.
Related News
About The Author
Author picture

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via

Popular News This Week