This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Designs for better debug info in GCC


On Dec 16, 2007, Joe Buck <Joe.Buck@synopsys.COM> wrote:

> However, since preserving accurate debug information
> has a cost, I think it would be better to turn -O1, not -O2, into the
> mode that Alexandre wants, where debug information is preserved.

In terms of memory, that's true, it does have a cost, for we have to
keep more information around.  That's one of the reasons why I'm
implementing this all under the control of a command-line option: you
can selectively enable or disable it, regardless of the level of
optimization.  If we want to make it default for -O1, but not for -O2,
sure, that works.

But this won't make much of a difference in terms of code change.
Except for the fact that we could simply leave alone the passes that
are only executed at -O2 or higher (which is not worth it, given that
I've already done the small work needed for them to keep debug info
accurate), most of the passes will still keep the information
accurate, nearly all of them without any code changes whatsoever.

So, doing this only for -O1 seems like a waste, given that -O2 is the
most common optimization level, and it's most often accompanied by -g.

> Trying to rework all optimizations to keep perfect debug information
> is going to take forever and make the compiler worse.

This statement is easy to make and to believe, but my approach is
proving it false, given a design that took this concern into account.

-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]