dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die.

2018-11-02  Richard Biener  <rguenther@suse.de>

	* dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call
	with is_type_die.

From-SVN: r265740
This commit is contained in:
Richard Biener 2018-11-02 07:55:49 +00:00 committed by Richard Biener
parent a412de9891
commit ea7e39004f
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2018-11-02 Richard Biener <rguenther@suse.de>
* dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call
with is_type_die.
2018-11-02 Richard Biener <rguenther@suse.de>
PR tree-optimization/87776

View file

@ -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. */