9.127 __return_address intrinsic

This intrinsic returns the return address of the current function.

Syntax

unsigned int __return_address(void)

Return value

The __return_address intrinsic returns the value of the link register that is used in returning from the current function.

Restrictions

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:
No optimization
When no optimizations are performed, the value returned by __return_address from within a function foo() is the return address of foo().
Inline optimization
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().
Tail-call optimization
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().
Related reference
9.104 __current_pc intrinsic
9.105 __current_sp intrinsic
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.