This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

> +/* Write an IL symbol table to OB. Â*/
>
> Âstatic void
> -produce_symtab (struct lto_streamer_cache_d *cache)
> +produce_symtab (struct output_block *ob,
> + Â Â Â Â Â Â Â cgraph_node_set set, varpool_node_set vset)

VSET and SET need documentation.


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]