On Wed, 9 Aug 2017, H.J. Lu wrote:
> > OK, but then both -f[no-]omit-frame-pointer do not have clearly defined
> > semantics and thus shouldn't be exposed to the user?
> -f[no-]omit-frame-pointer apply to cases where a new stack frame
> is needed. -fno-omit-frame-pointer allows you to unwind each
> stack frame, not necessarily each function, via frame pointer.
> -fno-omit-frame-pointer may not create a new stack frame for
> each function, similar to LTO or function inlining. But you can still
> unwind via frame pointer. We never guarantee that we will create
> a new stack frame for each function. Some functions are inlined
> completely. Some just use the caller's stack frame.
Maybe something along these lines should be added to the docu of
fno-omit-frame-pointer then. At least "Note that -fno-omit-frame-pointer
doesn't force a frame for all functions if it isn't otherwise needed, and
hence doesn't guarantee a frame pointer for all functions." .