diff options
author | Richard Biener <rguenther@suse.de> | 2020-11-05 09:27:28 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2020-11-05 10:20:30 +0100 |
commit | 1436ef2a57e79b6b8ce5b03e32a38dd64f46c97c (patch) | |
tree | de4c842f80b554d93c1dbc6398c471c577d4f245 /gcc/dwarf2out.c | |
parent | e3587a2d8b005d72f882a21864fb132f8a966366 (diff) | |
download | gcc-1436ef2a57e79b6b8ce5b03e32a38dd64f46c97c.zip gcc-1436ef2a57e79b6b8ce5b03e32a38dd64f46c97c.tar.gz gcc-1436ef2a57e79b6b8ce5b03e32a38dd64f46c97c.tar.bz2 |
debug/97718 - fix abstract origin references after last change
The change to clear the external_die_map slot after creating
the concrete instance DIE broke abstract origin processing which
tried to make sure to have those point to the early abstract instance
and not the concrete instance. The following restores this by
eventually following the abstract origin link in the concrete instance.
2020-11-05 Richard Biener <rguenther@suse.de>
PR debug/97718
* dwarf2out.c (add_abstract_origin_attribute): Make sure to
point to the abstract instance.
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 64ac94a..81cb734 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -21293,7 +21293,16 @@ add_abstract_origin_attribute (dw_die_ref die, tree origin) here. */ if (origin_die) - add_AT_die_ref (die, DW_AT_abstract_origin, origin_die); + { + dw_attr_node *a; + /* Like above, if we already created a concrete instance DIE + do not use that for the abstract origin but the early DIE + if present. */ + if (in_lto_p + && (a = get_AT (origin_die, DW_AT_abstract_origin))) + origin_die = AT_ref (a); + add_AT_die_ref (die, DW_AT_abstract_origin, origin_die); + } } /* We do not currently support the pure_virtual attribute. */ |