tags:

views:

77

answers:

3

I do always turn on this feature in my compilers, it helps a lot in debugging while reading through the assembly code which is more clean. I think it doesnt have a big impact on speed optimization side, giving CPUs ability to pipelining, but at least it does open a new opportunity for register allocation, as such, gaining a new free register EBP (not sure if compilers might use it though)

My question is: Is this approach safe anymore ? have you ever encoutered any peculiarities ?

A: 

I have never encountered any problems with -fomit-frame-pointer on GCC. But it indeed makes debugging worse.

MrMage
+1  A: 

If your software produces stack traces when it crashes, omitting the frame pointer can prevent that from working.

RichieHindle
A: 

The Gentoo wiki notes that fomit-frame-pointer can inhibit debugging. Otherwise, I don't think there's any real risk.

mipadi
it saids "... Though binary size may increase slightly. This flag breaks debugging on x86 and possibly other arches ..." I think this is the same issue with --finline-functions
ZeroCool