[lto][patch] Output references to variables used only in initializers
Richard Guenther
richard.guenther@gmail.com
Thu Dec 31 14:06:00 GMT 2009
On Wed, Dec 30, 2009 at 11:30 PM, Rafael Espindola <espindola@google.com> wrote:
> In cases like
>
> extern int c_common_attribute_table[];
> void *foobar = c_common_attribute_table
>
> We are correctly producing references to foobar, but we are not
> producing references to c_common_attribute_table. Tested the patch by
> running
>
> $ GNUTARGET=plugin nm --plugin liblto_plugin.so c-lang.o
>
> And checking that both c_common_attribute_table and foobar are in the
> IL symbol table.
>
> This is a reduction of building gcc with lto and the linker plugin.
Please add the testcase as well. Note that lto_output_tree{_ref}
are weird here in that outputting a reference doesn't guarantee
the object is output. Please add a comment according to this
at the point of the patch.
Ok with that change.
Thanks,
Richard.
> 2009-12-30 Rafael Avila de Espindola <espindola@google.com>
>
> * lto-streamer-out.c (output_unreferenced_globals): Output the full
> tree of an unreferenced global var.
>
> Cheers,
> --
> Rafael Ávila de Espíndola
>
More information about the Gcc-patches
mailing list