← Back to context

Comment by rwmj

1 year ago

You can turn it on/off per function by attaching one of these GCC attribute to the function declaration (although it doesn't work on LLVM):

  __attribute__((optimize("no-omit-frame-pointer")))
  __attribute__((optimize("omit-frame-pointer")))

The optimize fn attr causes other unintended side effects. Its usage is banned on the Linux kernel.