On 10:22 Thu 10 Feb , Paul Hartman wrote: > On Thu, Feb 10, 2011 at 9:24 AM, Stroller > <strol...@stellar.eclipse.co.uk> wrote: > > I don't really know what the "-fomit-frame-pointer" part does - I imagine > > someone suggested it, perhaps on here, years ago, and it has got copied > > from system to system. > > I think it removes your ability to get a stack trace when programs > crash, in exchange for potentially more speed. If you're a programmer > or filing bug reports on crashing software you should not use it, I > don't think. But I could be wrong. :)
Yep, that option leads to the frame pointer not being saved / restored, making an additional register available (but obviously there are differences between architectures; on some this option has no effect at all). On architectures where it does have an effect, it would make debugging impossible. Well, after having written the last paragraph I've decided to check out the GCC man page for more information and see: According to the GCC man page -fomit-frame-pointer gets enabled by default when using optimization levels -O or higher (including, of course -O2, which in my experience is what most people seem to use). As a matter of fact, I have -O2 but intentionally not set -fomit-frame-pointer, not being aware that with -O2, I automatically get it. ;-) I'll have to check out the Gentoo handbook, but if I remember correctly, it actually suggests using -O2 but better stay away from -fomit-frame-pointer. If it really suggests this, that might be considered a bug I guess. ;-) Greetings, Nils -- Nils Holland * Ti Systems, Wunstorf-Luthe (Germany) Powered by GNU/Linux since 1998