https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122248

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Faust <[email protected]>:

https://gcc.gnu.org/g:3073ae7fa70b29a495831359cc31d38ba1541d73

commit r16-4754-g3073ae7fa70b29a495831359cc31d38ba1541d73
Author: David Faust <[email protected]>
Date:   Tue Oct 28 11:13:25 2025 -0700

    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.
  • [Bug debug/122248] [16 regressi... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to