What’s the best g++ optimization level when building a debug target?

GCC 4.8 introduces a new optimization level: -Og for the best of both worlds.

-Og
Optimize debugging experience. -Og enables optimizations that do not interfere with
debugging. It should be the optimization level of choice for the standard
edit-compile-debug cycle
, offering a reasonable level of optimization while maintaining
fast compilation and a good debugging experience.

This way some optimization is done so you get better performance, better possibly-uninitialized variable detection and you can also step through a program in GDB without jumping back-and-forth through the function.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)