This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add used_by_single_function flag for static variables
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Bernhard Reutner-Fischer <rep dot dot dot nop at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Günther <rguenther at suse dot de>, Martin Jambor <mjambor at suse dot cz>
- Date: Fri, 14 Nov 2014 00:44:06 +0100
- Subject: Re: Add used_by_single_function flag for static variables
- Authentication-results: sourceware.org; auth=none
- References: <20140623042426 dot GB15978 at kam dot mff dot cuni dot cz> <CAC1BbcT8MpaRK4z2mbFoC=NuZameDh=TCo9hnL1dTPJ0+d2UmA at mail dot gmail dot com>
> Honza,
>
> On 23 June 2014 06:24, Jan Hubicka <hubicka@ucw.cz> wrote:
>
> > --- lto-cgraph.c (revision 211881)
> > +++ lto-cgraph.c (working copy)
> > @@ -614,6 +614,7 @@ lto_output_varpool_node (struct lto_simp
> > /* in_other_partition. */
> > }
> > bp_pack_value (&bp, node->tls_model, 3);
> > + bp_pack_value (&bp, node->used_by_single_function, 1);
> > streamer_write_bitpack (&bp);
> >
> > group = node->get_comdat_group ();
> > @@ -1275,6 +1276,7 @@ input_varpool_node (struct lto_file_decl
> > if (node->alias && !node->analyzed && node->weakref)
> > node->alias_target = get_alias_symbol (node->decl);
> > node->tls_model = (enum tls_model)bp_unpack_value (&bp, 3);
> > + node->used_by_single_function = (enum tls_model)bp_unpack_value (&bp, 1);
> > group = read_identifier (ib);
>
> Let's please remove the (wrong) cast to tls_model for the
> used_by_single_function bit.
Yep, it is obiovus pasto :)
> PS: lto-cgraph should seemingly be switched to use bp_unpack_enum(), no?
Yes, in genral lto-cgraph needs a lot of cleanups (most of that code was
written in early LTO days and needs a rewrite, it just never broke badly enough
to force it), I will try to schedule these early next stage 1.
> PPS: input_ref() speculative setting should also remove the wrong enum
> ipa_ref_use cast.
> I better stop reading here ;)
Hehe, just go ahead and keep me posted ;)
Honza
> cheers,