On Thu, Apr 05, 2012 at 02:30:10PM +0200, Vincent Lefevre wrote: > On 2012-04-05 08:17:57 -0400, Robert Dewar wrote: > > On 4/5/2012 8:06 AM, Vincent Lefevre wrote: > > >But no-optimizations (-O0) should not necessarily be the default > > >for these reasons. > > > > I think it is a problem that even at -O1 the debugger is > > seriously limited, especially for an inexperienced user. > > OK. > > Now, AFAIK, compiling and running programs occurs much more often > than debugging them. So, I would say that -O1 should be the default. > The user can still recompile his program with -O0 (or future better > option) if he needs to run the debugger on it; if he doesn't know > that, there should be some feature in the debugger to tell the user > what to do.
Better would be to improve the output from -O1 so it is usable by a debugger, even if this might require generating slightly less optimized code at -O1 than is done now. > > > What is missing to me is a reasonable cleanup of the code that > > would remove some of the junk at -O0 but not impact debugging. > > In fact a reasonable criterion would be all the optimization > > that is cheap to do and does not affect debugging. > > I think that for debugging, there should be a single option to > disable optimizations that are unsafe for the debugger and that > would add debugging information (such as what -g does). In short, > the user would just have to add this option, which should do all > the magic for debugging. No, absolutely not. Turning on debugging should not change what the generated code looks like. Depending on the bug it is quite possible for changes in optimization to hide the symptoms of the bug, thereby making it more difficult to track down the bug. -- <Insert your favourite quote here.> Erik Trulsson ertr1...@student.uu.se