Fix compute_reloc_for_constant

Richard Biener richard.guenther@gmail.com
Sun Jan 19 13:56:00 GMT 2014


On Sun, Jan 19, 2014 at 3:12 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> while comparing LTO and non-LTO builds I noticed that with LTO we produce a lot
> more vtables in datal.rel.ro rather than data.rel.ro.local
> This is because of partitioning promoting more symbols global. For RTL we make
> section decisions based on SYMBOL_REF_LOCAL_FLAG that is set based on
> decl_binds_local_p.  For variables we use TREE_PUBLIC check that is overly
> conservative.
>
> Bootstrapped/regtested x86_64-linux, OK?

Ok.

Thanks,
Richard.

>         * varasm.c (compute_reloc_for_constant): Use targetm.binds_local_p
>         instead of TREE_PUBLIC to determine if reference will be local
>         within given DSO or not.
> Index: varasm.c
> ===================================================================
> --- varasm.c    (revision 206684)
> +++ varasm.c    (working copy)
> @@ -4060,7 +4060,7 @@
>           break;
>         }
>
> -      if (TREE_PUBLIC (tem))
> +      if (!targetm.binds_local_p (tem))
>         reloc |= 2;
>        else
>         reloc |= 1;



More information about the Gcc-patches mailing list