[Google] fix a bug in lipo varpool node linking

Xinliang David Li davidxl@google.com
Fri Aug 16 22:06:00 GMT 2013


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



More information about the Gcc-patches mailing list