http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57334

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #6)
> I am testing
> Index: lto-symtab.c
> ===================================================================
> --- lto-symtab.c        (revision 200151)
> +++ lto-symtab.c        (working copy)
> @@ -523,7 +523,8 @@ lto_symtab_merge_decls (void)
>  
>    FOR_EACH_SYMBOL (node)
>      if (lto_symtab_symbol_p (node)
> -       && node->symbol.next_sharing_asm_name)
> +       && (node->symbol.next_sharing_asm_name
> +           || node->symbol.previous_sharing_asm_name))
>        {
>          symtab_node n;
>  
> @@ -639,6 +640,7 @@ lto_symtab_prevailing_decl (tree decl)
>    ret = symtab_node_for_asm (DECL_ASSEMBLER_NAME (decl));
>    if (!ret)
>      return decl;
> +  gcc_checking_assert (TREE_PUBLIC (ret->symbol.decl) && !DECL_EXTERNAL
> (ret->symbol.decl));
>  
>    return ret->symbol.decl;
>  }

The loop looks weird.  It probably should be re-structured to a simple

  FOR_EACH_SYMBOL (node)
    if (!node->symbol.prev_sharing_asm_name
        && node->symbol.next_sharing_asm_name)
      lto_symtab_merge_decls_1 (node);

and not put too much magic into it.

Reply via email to