dwarf2out.c (build_abbrev_table): Guard lookup_external_ref call with is_type_die.
authorRichard Biener <rguenther@suse.de>
Fri, 2 Nov 2018 07:55:49 +0000 (07:55 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 2 Nov 2018 07:55:49 +0000 (07:55 +0000)
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

gcc/ChangeLog
gcc/dwarf2out.c

index 90d11f5038d1845cfac4519deca8b2351143fdd9..9b583eea0bd3567b16e350877d26836b252fcf3d 100644 (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
index 30bbfee90521dfe417f12c3813dcc4022eea3a57..8b478aa265fd83f0d4faf8c0f360356734128ab5 100644 (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.  */