diff options
| author | David Faust <david.faust@oracle.com> | 2025-10-28 11:13:25 -0700 | 
|---|---|---|
| committer | David Faust <david.faust@oracle.com> | 2025-10-30 09:26:23 -0700 | 
| commit | 3073ae7fa70b29a495831359cc31d38ba1541d73 (patch) | |
| tree | ab972ece90e380f506a1fa0a73704eacf9e0a657 /gcc/fortran/trans-array.cc | |
| parent | d5f30b7d5285679805796461beeb2f7ce4b25c44 (diff) | |
| download | gcc-3073ae7fa70b29a495831359cc31d38ba1541d73.zip gcc-3073ae7fa70b29a495831359cc31d38ba1541d73.tar.gz gcc-3073ae7fa70b29a495831359cc31d38ba1541d73.tar.bz2  | |
dwarf: handle repeated decl with different btf_decl_tags [PR122248]
The check in gen_btf_tag_dies which asserted that if the target DIE
already had an annotation then it must be the same as the one we are
attempting to add was too strict.  It is valid for multiple declarations
of the same object to appear with different decl_tags, in which case the
tags from each are accumulated in DECL_ATTRIBUTES.  The existing
annotation may not be the same as the one being added, since new tags
will be added to the head of the chain.
The proper behavior is to always replace any existing AT_GNU_annotation
to refer to the chain of annotations we have just constructed, whether
the head of that chain is the same or not.
	PR debug/122248
gcc/
	* dwarf2out.cc (gen_btf_tag_dies): Always replace an existing
	AT_GNU_annotation on the target die.
gcc/testsuite/
	* gcc.dg/debug/dwarf2/dwarf-btf-decl-tag-4.c: New.
	* gcc.dg/debug/dwarf2/dwarf-btf-decl-tag-5.c: New.
	* gcc.dg/debug/dwarf2/dwarf-btf-decl-tag-6.c: New.
Diffstat (limited to 'gcc/fortran/trans-array.cc')
0 files changed, 0 insertions, 0 deletions
