Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22117

Compiling with both -g3 and -O3

$
0
0

Most build environments I've seen have at least two strategies: debug build vs final/optimized/release build. With gcc, this usually means some version of -g vs -O. Now I'm seeing a situation where the optimized build is built with -O3 while the debug version is built with -g3and-O3. man gcc does indicate that is possible, but this seems counterintuitive to me for real debugging purposes.

Reviewing http://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html reminded me of -Og, which allows optimizations that do not interfere with debugging. That makes sense to me, but what compelling reason is there to debug with -O3 -g3 unless you are basically trying to debug gcc's own optimization abilities?


Viewing all articles
Browse latest Browse all 22117

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>