This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 4/6] Shrink-wrapping
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, "richard dot sandiford at linaro dot org" <richard dot sandiford at linaro dot org>
- Date: Thu, 07 Jul 2011 16:54:53 +0100
- Subject: Re: [PATCH 4/6] Shrink-wrapping
- References: <4D8A0703.9090306@codesourcery.com> <4D8A095C.8050809@codesourcery.com> <g4vcvegnx9.fsf@linaro.org>
On 07/07/11 15:34, Richard Sandiford wrote:
> It seems a shame to have both (return) and (simple_return). You said
> that we need the distinction in order to cope with targets like ARM,
> whose (return) instruction actually performs some of the epilogue too.
> It feels like the load of the saved registers should really be expressed
> in rtl, in parallel with the return. I realise that'd prevent
> conditional returns though. Maybe there's no elegant way out...
You'd still need to deal with distinct returns for shrink-wrapped code
when the full (return) expands to
ldm sp, {regs..., pc}
The shrink wrapped version would always be
bx lr
There are also cases (eg on v4T) where the Thumb return sequence
sometimes has to pop into a lo register before branching to that return
address, eg
pop {r3}
bx r3
in order to get interworking.
R.