This function returns the return address of the current function, or of one of its callers. The level argument is number of frames to scan up the call stack. A value of
0yields the return address of the current function, a value of1yields the return address of the caller of the current function, and so forth. When inlining the expected behavior is that the function returns the address of the function that is returned to. To work around this behavior use thenoinlinefunction attribute.
The short answer: -O0 completely suppresses function inlining, and thereOn Wed, 30 Jul 2014 09:03:38 -0500, Xin Tong said:
> Ive heard that one can not build the entire Linux kernel with -O0 option.
> why is that ? being a compiler developer, i can not think of reasons why
> that is the case.
are several places where the kernel depends on inlining for correct
operation (most notably with things like __builtin_return_address()
and friends for introspecting the stack, but there's a few other
corner cases I can't remember at the moment...)