This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto][patch] Output references to variables used only in initializers
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Diego Novillo <dnovillo at google dot com>
- Date: Wed, 30 Dec 2009 23:56:17 +0100
- Subject: Re: [lto][patch] Output references to variables used only in initializers
- References: <38a0d8450912301430g2f2cf71eg7324a0cfa802016f@mail.gmail.com>
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
>