On Sat, Feb 21, 2015 at 01:24:55PM +0000, Iain Sandoe wrote:
> P.S. The patch does solve a problem with ADT/SmallVectorTests.cpp in llvm 
> suite (with generation of a varargs thunk).
> However, it does not appear to restore sibcall-3 for m32 darwin (see. pr63892 
> for updated analysis).
> 
> gcc 
>       * ipa-icf.c (sem_function::merge): Do not try to redirect unless the 
> target supports
>       symbol aliases.

No, that looks wrong.  It is very much intentional, there should be no
reason why even without proper support of aliases you couldn't redirect
callers.  Callers redirection is done by just changing the IL, there is
really no need for any backend support for that.
Just look at the sibcall-3.c testcase.

> diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
> index e1af8bf..f128494 100644
> --- a/gcc/ipa-icf.c
> +++ b/gcc/ipa-icf.c
> @@ -662,6 +662,7 @@ sem_function::merge (sem_item *alias_item)
>        redirect_callers
>       = (!original_discardable
>          && !DECL_COMDAT_GROUP (alias->decl)
> +        && sem_item::target_supports_symbol_aliases_p ()
>          && alias->get_availability () > AVAIL_INTERPOSABLE
>          && original->get_availability () > AVAIL_INTERPOSABLE
>          && !alias->instrumented_version);

        Jakub

Reply via email to