| |||
| Home > Compiler-specific Features > __return_address intrinsic | |||
This intrinsic returns the return address of the current function.
The __return_address intrinsic returns
the value of the link register that is used in returning from the
current function.
The __return_address intrinsic does not affect
the ability of the compiler to perform optimizations such as inlining,
tailcalling, and code sharing. Where optimizations are made, the value
returned by __return_address reflects the optimizations
performed:
When no optimizations are performed,
the value returned by __return_address from
within a function foo is the return address
of foo.
If a function foo is inlined into a function bar then
the value returned by __return_address from
within foo is the return address of bar.
If a function foo is tail-called
from a function bar then the value returned
by __return_address from within foo is
the return address of bar.