This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GOOGLE] Refine LIPO aux function removal
- From: Xinliang David Li <davidxl at google dot com>
- To: Teresa Johnson <tejohnson at google dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 2 Jan 2015 22:27:06 -0800
- Subject: Re: [GOOGLE] Refine LIPO aux function removal
- Authentication-results: sourceware.org; auth=none
- References: <CAAe5K+UTk9CmGSfmxerFgXn6tDRq7CVGu51F4CvCHQWNpvrGUA at mail dot gmail dot com>
ok.
David
On Fri, Jan 2, 2015 at 10:19 PM, Teresa Johnson <tejohnson@google.com> wrote:
> Fixes a problem caused by my recent change to allow aux functions to
> be removed. They need to be kept until after LIPO linking/static
> promotion, since they affect the promoted names of any static
> variables defined within their context.
>
> Passes regression and internal testing. Ok for google/4_9?
>
> Thanks,
> Teresa
>
> 2015-01-02 Teresa Johnson <tejohnson@google.com>
>
> Google ref b/18882262.
> * cgraph.c (cgraph_can_remove_if_no_direct_calls_and_refs_p): Keep
> aux functions until after LIPO linking.
>
> Index: cgraph.c
> ===================================================================
> --- cgraph.c (revision 219100)
> +++ cgraph.c (working copy)
> @@ -2462,8 +2462,13 @@ cgraph_can_remove_if_no_direct_calls_and_refs_p (s
> {
> gcc_assert (!node->global.inlined_to);
> /* Extern inlines can always go, we will use the external definition. */
> - if (DECL_EXTERNAL (node->decl) || cgraph_is_aux_decl_external (node))
> + if (DECL_EXTERNAL (node->decl))
> return true;
> + /* Aux functions are safe to remove, but only once static promotion is
> + complete since they may affect promoted names if they are the context
> + for any static variables. */
> + if (cgraph_pre_profiling_inlining_done && cgraph_is_aux_decl_external (node))
> + return true;
> /* When function is needed, we can not remove it. */
> if (node->force_output || node->used_from_other_partition)
> return false;
>
> --
> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413