On Mon, Jun 25, 2007 at 12:48:10PM -0400, Mark Mitchell wrote:
> I was suggesting leaving the hook alone, but modifying the test for the
>  sibling call optimization in rs6000_function_ok_for_sibcall to:
> 
>   !DECL_EXTERNAL (decl) && binds_local_p (decl)
> 
> In other words, per Jakub's argument, consider binds_local_p to be
> correct (even on Power), but just note in the back end that
> binds_local_p isn't a sufficient test for being safe for a sibling call.

I guess the right thing to do would be to replace the current
3 uses of SYMBOL_REF_LOCAL_P (x) macro in config/rs6000/*.md
with
SYMBOL_REF_LOCAL_P (x) && (!TARGET_ARCH64 || !SYMBOL_REF_EXTERNAL_P (x))

where TARGET_ARCH64 is replaced by whatever ppc* subarches need multi-toc.

SYMBOL_REF_LOCAL_P is used even in generic code and there the current
definition is ok - SYMBOL_REF_LOCAL_P symbols won't need global relocations.

Similarly other uses of binds_local_p I have checked.

        Jakub

Reply via email to