On 03/01/2018 19:02, Marc-André Lureau wrote: > Hi > > On Wed, Jan 3, 2018 at 6:52 PM, Peter Maydell <peter.mayd...@linaro.org> > wrote: >> On 2 January 2018 at 17:31, Paolo Bonzini <pbonz...@redhat.com> wrote: >>> 2) I think removing -O2 from --enable-debug should be removed at the >>> same time. That pretty much guarantees that nobody will use >>> --enable-debug, and optimized builds are decently debuggable nowadays. >>> The best would be to detect -Og, and add either -Og or -O1 depending on >>> presence. >> >> Hmm. I use --enable-debug all the time and one of the reasons >> I use it is that the optimized build is usually more pain >> to debug with... > > -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. > > That should cover debugging nicely. Tbh, I am quite happy with > compiler default to O0 when --enable-debug. Og doesn't give me much > different experience. > > However, it produces false-positive warnings with gcc.
-O0 doesn't enable those warnings at all, because it would have even more false positives. :) Paolo