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]

Re: Live range splitting in new allocator


On 29-Jan-2001, Linus Torvalds <torvalds@transmeta.com> wrote:
> The debugger problem comes up not infrequently as a reason for gcc doing
> the wrong thing.

How about some generalization of the `-fomit-frame-pointer' option,
e.g. `-fundebuggable-optimizations', which tells the compiler that it
is OK to perform optimizations that might break the debugger?
`-fundebuggable-optimizations' could imply `-fomit-frame-pointer',
and would also permit live range splitting and other things which
prevent debugging.  Compiling with `-g -fundebuggable-optimizations'
would be allowed, although it might be nice for the compiler to issue
a warning about that combination.

Note that `-foptimize-sibling-call' is another optimization which has
harmful effects on debugging.  Perhaps that should not be enabled by
`-O2' and instead should only be enabled by `-fundebuggable-optimizations'.
Hmm, "undebuggable" isn't quite the right word.  Really these optimizations
just make things harder to debug, they don't necessarily make it impossible.
Perhaps `-fallow-optimizations-that-harm-debugging'? ;-) 
Any suggestions for a more concise spelling?

For the Mercury front-end, inhibiting optimizations because they might
break gdb seems like a very bad idea, since gdb is in most cases
pretty useless for ordinary Mercury developers.  The main problem is
that gdb doesn't know how to print out Mercury data structures.
Furthermore gdb doesn't handle Mercury code that uses backtracking
very well, since the mapping from that to GCC trees is quite
non-trivial, and since gdb doesn't know anything about the four-port
model (call/exit/redo/fail) used for debugging nondeterminstic code.
Modifying gdb to handle Mercury well would be a lot of effort,
probably more effort than doing the interface with the GCC back-end
was.  Instead, we have our own debugger `mdb', which uses our own
format of debug information that we put in the executable as ordinary
read-only static constants (i.e. .rodata).  We plan to adapt mdb to
work with the GCC back-end version of the Mercury compiler.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.

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