04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Compiler-specific Features<br />

See also<br />

• REV, REV16, REVSH, and RBIT on page 4-65 in the Assembler Guide.<br />

4.7.28 __return_address<br />

This intrinsic returns the return address of the current function.<br />

Syntax<br />

unsigned int __return_address(void)<br />

Return value<br />

The __return_address intrinsic returns the value of the link register that is used in<br />

returning from the current function.<br />

Restrictions<br />

The __return_address intrinsic does not affect the ability of the compiler to perform<br />

optimizations such as inlining, tail-calling, and code sharing. Where optimizations are<br />

made, the value returned by __return_address reflects the optimizations performed:<br />

No optimization<br />

When no optimizations are performed, the value returned by<br />

__return_address from within a function foo is the return address of foo.<br />

Inline optimization<br />

If a function foo is inlined into a function bar then the value returned by<br />

__return_address from within foo is the return address of bar.<br />

Tail-call optimization<br />

If a function foo is tail-called from a function bar then the value returned<br />

by __return_address from within foo is the return address of bar.<br />

See also<br />

• Other builtin functions on page 4-197<br />

• __current_pc on page 4-78<br />

• __current_sp on page 4-78<br />

• Legacy inline assembler that accesses sp, lr, or pc on page 7-27 in the Compiler<br />

User Guide.<br />

<strong>ARM</strong> DUI 0348C Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. 4-95<br />

ID101213<br />

Non-Confidential,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!