[lto][patch] Fix reading of cgraph when multiple files are passed to lto1
Simon Baldwin
simonb@google.com
Fri Oct 24 12:30:00 GMT 2008
...and I just ran into it. Thanks for catching.
--S
Rafael Espindola wrote:
> While reading multiple files, cgraph_nodes contains the nodes from all
> previous files. Because of this, the inlined_to field was getting
> corrupted if lto1 was passed multiple files.
>
> 2008-10-24 Rafael Espindola <espindola@google.com>
>
> * lto-lang.c (input_cgraph_1): Iterate over nodes, not cgraph_nodes.
>
> Cheers,
>
> ------------------------------------------------------------------------
>
> diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
> index 52872fa..089dee2 100644
> --- a/gcc/lto/lto-lang.c
> +++ b/gcc/lto/lto-lang.c
> @@ -1317,7 +1317,7 @@ input_cgraph_1 (struct lto_file_decl_data* file_data,
>
> if (flag_ltrans)
> {
> - for (node = cgraph_nodes; node; node = node->next)
> + for (i = 0; VEC_iterate (cgraph_node_ptr, nodes, i, node); i++)
> {
> const int ref = (int) (intptr_t) node->global.inlined_to;
>
>
--
Google UK Limited | Registered Office: Belgrave House, 76 Buckingham
Palace Road, London SW1W 9TQ | Registered in England Number: 3977902
More information about the Gcc-patches
mailing list