This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Designs for better debug info in GCC
Alexandre Oliva wrote:
Yes, I've considered something along these lines, but decided against
it, for we can't afford for debug information to affect executable
code generation in any way whatsoever, and we don't want to pessimize
optimized code when compiling without -g just so that compiling with
-g would get us the same code.
I disagree, I think it would be fine to degrade -O1 slightly to achieve
full debuggability, and of course -g cannot affect the generated code.
If indeed
a) it is possible to get perfect debuggability without any pessimization
b) that includes unexpected jumping around
c) everyone agrees on how to achieve a) and b)
d) this is implemented
then fine, but in the absence of these conditions, if we need to
pessimize -O1 code slightly to achieve this, that's OK by me. If
it really worries people, introduce a -Og that achieves this. In
my experience people use -O1 not because they are very performance
sensitive (those folk use -O2), but because -O0 is so horrible,
that they need something better than that for production delivery.