Q: -fno-omit-frame-pointer

Linda A. Walsh gcc@tlinx.org
Wed Apr 7 07:00:10 GMT 2021


On 2021/03/31 14:23, Oleg Smolsky via Libc-help wrote:
> Folks, what is the default for x88-64 builds w.r.t. the frame pointers? (I
> think it's "off"). I couldn't find a configure.ac option to tweak that...
> yet it's easy to force via CFLAGS.
>   
The defaults may be different on your machine and by debug/optimization
switches.

To see which switches are turned on for a given optimization,
use -Q -O(0-3) --help=optimizers
On my machine, I ran
 gcc -c -Q -O3 --help=optimizers >/tmp/O3-opts 
subbing in O2, O1 and O0 then searching through the output:
grep omit-frame *opts
O0-opts:  -fomit-frame-pointer            [disabled]
O1-opts:  -fomit-frame-pointer            [enabled]
O2-opts:  -fomit-frame-pointer            [enabled]
O3-opts:  -fomit-frame-pointer            [enabled]
---

So looks like frame-ptr is usually omitted, but not in O0...
Debug options may also affect it being turned on or off...





More information about the Libc-help mailing list