This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RETURN_ADDRESS_POINTER_REGNUM Macro


On 07/23/2015 11:09 PM, Ajit Kumar Agarwal wrote:
> From the description of the definition of the macro RETURN_ADDRESS_POINTER_REGNUM , 

> Does this impact the performance or correctness of the compiler?  On what cases it is applicable to define for the given architecture?

This is used to help implement the __builtin_return_address builtin
function.  There is some default code for this, so it may work OK
without defining RETURN_ADDRESS_POINTER_REGNUM.  If the default code
doesn't work, then you may need to define RETURN_ADDRESS_POINTER_REGNUM.

Usually, it is trivial to make __builtin_return_address work for leaf
functions, non-trivial to make it work for non-leaf functions, and
difficult to impossible to make it work for level != 0.  You will have
better luck using the unwind info than __builtin_return_address.

This is an optional builtin function, so there is no performance or
correctness issue here.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]