I was wondering what -fno-omit-frame-pointer will do without optimization?
CXXFLAGS = -Wall -ggdb3 -DDEBUG -fno-omit-frame-pointer
Isn't it that fomit-frame-pointer auto turned on at all levels of -O (except -O0)? I assume in my example it is -O0 by default.
Thanks and regards!
Use -O0 to disable them and use -S to output assembly. -O3 is the highest level of optimization. Starting with gcc 4.8 the optimization level -Og is available. It enables optimizations that do not interfere with debugging and is the recommended default for the standard edit-compile-debug cycle.
GCC has a range of optimization levels, plus individual options to enable or disable particular optimizations. The overall compiler optimization level is controlled by the command line option -On, where n is the required optimization level, as follows: -O0 . (default).
As you already imply yourself, -fno-omit-frame-pointer
is just ignored in your case, as the frame pointer wouldn't be ommitted anyways in the default -O0.
As I understand it Ox are just shortcuts for a set of optimization flags. The default optimization is zero, so using one flag without Ox, should do just that optimization.
In my opinion, omitting the frame pointer increases debugging difficulty for a modest performance gain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With