https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66394

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
Situation with all branches younger than 4.8 is:

4.8-branch: a bit different issue is touched and fixed in r208454, I'm going to
test a backport from 4.9 branch
4.9-branch - master: in r201468 Honza added streaming of abstract origin so
that it's going to improved debug info. Unfortunately, as -fmerge-all-constants
is passed, varpool_node::get (DECL_ABSTRACT_ORIGIN (vnode->decl)) can be equal
to NULL.

I'm going to test following patch:

diff --cc gcc/lto-cgraph.c
index b5fd83e,07eebfc..0000000
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@@ -942,8 -807,8 +942,10 @@@ compute_ltrans_boundary (lto_symtab_enc
        if (DECL_ABSTRACT_ORIGIN (vnode->decl))
        {
          varpool_node *origin_node
 -        = varpool_node_for_decl (DECL_ABSTRACT_ORIGIN (vnode->decl));
 -        lto_set_symtab_encoder_in_partition (encoder, origin_node);
 +          = varpool_node::get (DECL_ABSTRACT_ORIGIN (vnode->decl));
-         lto_set_symtab_encoder_in_partition (encoder, origin_node);
++
++        if (origin_node)
++          lto_set_symtab_encoder_in_partition (encoder, origin_node);
        }
      }
    /* Pickle in also the initializer of all referenced readonly variables

Thanks,
Martin

Reply via email to