This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Google] fix a bug in lipo varpool node linking


ok.

David

On Fri, Aug 16, 2013 at 1:28 PM, Rong Xu <xur@google.com> wrote:
> This patch fixed a bug in lipo varpool node linking.
>
> C++ FE drops the initializer if it's not used in this TU. For current
> varpool linking may
> resolve the varpool node to the one with null initializer.
>
> -Rong
>
>
> Index: l-ipo.c
> ===================================================================
> --- l-ipo.c     (revision 201800)
> +++ l-ipo.c     (working copy)
> @@ -2151,6 +2151,19 @@ resolve_varpool_node (struct varpool_node **slot,
>        return;
>      }
>
> +  if (DECL_INITIAL (decl1) && !DECL_INITIAL (decl2))
> +    {
> +      merge_addressable_attr (decl1, decl2);
> +      return;
> +    }
> +
> +  if (!DECL_INITIAL (decl1) && DECL_INITIAL (decl2))
> +    {
> +      *slot = node;
> +      merge_addressable_attr (decl2, decl1);
> +      return;
> +    }
> +
>    /* Either all complete or neither's type is complete. Just
>       pick the primary module's decl.  */
>    if (!varpool_is_auxiliary (*slot))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]