This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Rewrite lto symtab streaming
> On Mon, Jul 5, 2010 at 21:56, Jan Hubicka <hubicka@ucw.cz> wrote:
> >
> > Hi,
> > this patch fixes another problem seen in Mozilla build. ?Here we optimize out
> > comdat function, but its reference stays in function body in debug info. ?THis
> > makes produce_symtab to output it into symbol table section that makes gold
> > to prevail all other real copies by this non-existent function.
> >
> > This patch rewrites symbol table streaming to walk callgraph, varpool and
> > alias pairs and output only what is really there.
> >
> > Bootstrapped/regtested x86_64-linux, tested on mozilla build, OK?
> >
> > Honza
> >
> > ? ? ? ?* lto-streamer.c (write_symbol_vec): Rename to ...
> > ? ? ? ?(write_symbol) ... this one; write only symbol given and when
> > ? ? ? ?present in cache. Sanity check that what is defined is present
> > ? ? ? ?in cgraph/varpool with body/finalized decl.
> > ? ? ? ?(write_symbols_of_kind): Remove.
> > ? ? ? ?(produce_symtab): Take outputblock and sets; use cgraph/varpool/alias
> > ? ? ? ?pairs to produce symtab.
> > ? ? ? ?(produce_asm_for_decls): Update call of produce_symtab; don't do so
> > ? ? ? ?when doing WPA streaming.
>
> Nice cleanup! OK with some minor comments:
>
> > -/* Helper function of write_symbols_of_kind. ?CACHE is the streamer
> > - ? cache with all the pickled nodes. ?STREAM is the stream where to
> > - ? write the table. ?V is a vector with the DECLs that should be on
> > - ? the table. ?SEEN is a bitmap of symbols written so far. ?*/
> > +/* Write symbol T into STREAM in CACHE. SEEN specify symbols we wrote so far.
> > + ? */
>
> Watch line wrapping.
>
> > + ? ? ?/* When something is defined, it should have node attached. ?*/
>
> s/have node/have a node/
>
> I wonder if these should be error/fatal_error instead of assertions.
Well, those are internal consistency checks rather than something user can
get wrong. We have a lot of assterts that should be fatals at LTO reading
(and a lot of unchecked errors). I guess we will need to revamp streaming
sooner or later anyway.
Thanks!
Honza