public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/111735] incorrect BTF representation of forward-declared enums
Date: Tue, 19 Dec 2023 18:00:34 +0000	[thread overview]
Message-ID: <bug-111735-4-yQCRkkPwF9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111735-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Faust <dfaust@gcc.gnu.org>:

https://gcc.gnu.org/g:1502d724df85163b14b04e8f67072ca88eac411d

commit r14-6716-g1502d724df85163b14b04e8f67072ca88eac411d
Author: David Faust <david.faust@oracle.com>
Date:   Tue Dec 12 13:55:59 2023 -0800

    btf: change encoding of forward-declared enums [PR111735]

    The BTF specification does not formally define a representation for
    forward-declared enum types such as:

      enum Foo;

    Forward-declarations for struct and union types are represented by
    BTF_KIND_FWD, which has a 1-bit flag distinguishing the two.

    The de-facto standard format used by other tools like clang and pahole
    is to represent forward-declared enums as BTF_KIND_ENUM with vlen=0,
    i.e. as a regular enum type with no enumerators.  This patch changes
    GCC to adopt that format, and makes a couple of minor cleanups in
    btf_asm_type ().

    gcc/

            PR debug/111735
            * btfout.cc (btf_fwd_to_enum_p): New.
            (btf_asm_type_ref): Special case references to enum forwards.
            (btf_asm_type): Special case enum forwards. Rename btf_size_type to
            btf_size, and change chained ifs switching on btf_kind into else
ifs.

    gcc/testsuite/

            PR debug/111735
            * gcc.dg/debug/btf/btf-forward-2.c: New test.

      parent reply	other threads:[~2023-12-19 18:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 11:37 [Bug debug/111735] New: " gprocida at google dot com
2023-12-05 23:05 ` [Bug debug/111735] " david.faust at oracle dot com
2023-12-19 18:00 ` cvs-commit at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111735-4-yQCRkkPwF9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).