On 17/12/2012 15:20, Rich Freeman wrote:
> Uh, sure, insofar as it is possible to stop doing something that
> you've done exactly once...  :)

In general, I've heard the same suggestion touted too many times
already. It's this kind of misinformation and cargo culting that often
causes `strip-flags` to be used (even when gcc codegen is perfectly
fine), or that make upstream complain that Gentoo users are ricers for
not sticking with -O0.

> However, I've found it a useful tool, assuming the error is still
> reproducible.  If it prevents the error from being reproduced it is
> obviously less useful. 

By experience with the kind of crashes we get reported on bugzilla,
roughly eight times out of ten it's perfectly pointless to use -O0.

_FORTIFY_SOURCES overflows can't happen at -O0.
Uninitialized variables are zeroed out at -O0.

At -O0 you're debugging a completely different program. Sure it's
possible that the crash is so blatantly broken than it will crash
anyway, but that kind of crashes tend to be extremely rare and easy to
catch to begin with.

In most cases, you just want to know the ballpark of where the crash is
happening, as you want to know which assumption is not holding up.

> I for one like having all parameters on my
> stack frame, but perhaps there is another switch that will only toggle
> this.

There is, but it can stop constant propagation from working properly. If
we're discussing about crashes, which is what debug information in
general is useful for, -O0 is useless in most cases.

It's a different story altogether if you go into what a developer would
do to debug a particularly nasty crash, or to see why something's
misbehaving, and you want to use gdb rather than fill your code of
printf() statements. But that's a completely different story, so let's
leave it at that.

-- 
Diego Elio Pettenò — Flameeyes
flamee...@flameeyes.eu — http://blog.flameeyes.eu/

Reply via email to