When you want to build something that\'s debuggable (g++ specifically, but perhaps shares an answer with gcc), what\'s the best -O level? In other words, when building a \"
debugging mode (the -g) and optimization levels (the -O* family) are independent issues. the -g flag basically instructs gcc to include debugging symbols when compiling (and some hints corresponding to line numbers in the code). It can be applied to any optimization level.
The simple answer, therefore, is "the best g++ optimization level when building the production program", which is a much longer discussion