[PATCH/RFC] PR target/15130 SH: A tail call optimization

Joern Rennecke joern.rennecke@superh.com
Fri Apr 30 15:21:00 GMT 2004


> 
> 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.



More information about the Gcc-patches mailing list