This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: how can RETURN_ADDR_RTX possibly do its work?
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: dk at artimi dot com (Dave Korn)
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 25 May 2004 15:25:43 +0100 (BST)
- Subject: Re: how can RETURN_ADDR_RTX possibly do its work?
> Is there some better solution to this problem that I'm overlooking? The
> rs6000 solution of setting a flag to force the epilog generator to save the
> link register whether it thinks it needs to or not seems like the most
> robust to me, and I guess it's only a very tiny pessimisation in only those
> leaf functions that call __builtin_return_address, but it still seems
> inelegant to me.
The SH uses the result of get_hard_reg_initial_val and wraps it in an UNSPEC.
This is matched with a define_insn_and_split. ALLOCATE_INITIAL_VALUE
is used to avoid storing the return address twice.
For TARGET_SHCOMPACT it gets a bit more tricky because of the call / return
'trampolines', but you probably don't need that much detail...