This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/RFC] PR target/15130 SH: A tail call optimization
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: kkojima at rr dot iij4u dot or dot jp (Kaz Kojima)
- Cc: joern dot rennecke at superh dot com, gcc-patches at gcc dot gnu dot org, aoliva at redhat dot com
- Date: Fri, 30 Apr 2004 15:59:12 +0100 (BST)
- Subject: Re: [PATCH/RFC] PR target/15130 SH: A tail call optimization
>
> Joern Rennecke <joern.rennecke@superh.com> wrote:
> >> The appended patch is to take account of this case. It always
> >> scans registers to get an available register in epilogue case.
> >
> > It seems to me that this unnecessarily slows down compilation at -O0.
> > Could you try to use (epilogue_p && flag_optimize_sibling_calls)
> > instead? This also has the advantage of being more self-documenting.
>
> Sounds a good idea. It even makes the patch smaller.
> How about the patch below? I'm regtesting it now.
The patch as such look OK, however, as a re-read the code that you are
patching, it appears to me that we have a latent bug here, which will
be made worse by your patch.
We are testing only for the general purpose registers used up by DImode
values (or smaller). This seems to always give you r2.
If the function returns a 128 bit value in general purpose registers,
e.g. CDImode, TImode, or DCmode (the latter for soft floating point),
then r2 is live.