From: Richard Biener Date: Fri, 2 Nov 2018 07:55:49 +0000 (+0000) Subject: dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea7e39004f444a9f019631b2c5de4d56ffc9c71b;p=gcc.git dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die. 2018-11-02 Richard Biener * dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die. From-SVN: r265740 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 90d11f5038d..9b583eea0bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-02 Richard Biener + + * dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call + with is_type_die. + 2018-11-02 Richard Biener PR tree-optimization/87776 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 30bbfee9052..8b478aa265f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9023,8 +9023,9 @@ build_abbrev_table (dw_die_ref die, external_ref_hash_type *extern_map) struct external_ref *ref_p; gcc_assert (AT_ref (a)->comdat_type_p || AT_ref (a)->die_id.die_symbol); - ref_p = lookup_external_ref (extern_map, c); - if (ref_p->stub && ref_p->stub != die) + if (is_type_die (c) + && (ref_p = lookup_external_ref (extern_map, c)) + && ref_p->stub && ref_p->stub != die) change_AT_die_ref (a, ref_p->stub); else /* We aren't changing this reference, so mark it external. */