From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB2F0385DC3E; Tue, 19 Dec 2023 18:00:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB2F0385DC3E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703008834; bh=rC+wpQqgVPJNj6ts4WZ+2ZaTDYptftEennqpv9MiH5w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ybOqDEfivKYvEa8kQEsmY1PYxsb6lrUdo3/7dNN1kAfh50A/9VH6RQIITkOXRkKct Zkx0b/FbfbuAyPeCUSvod43CQlZeOG7rKkqN5heMbk5Uj2CfspE9++oeTQZDGJOiXQ 1IzUwq12xzZ4iyBAjMQErf93fvuXh6zIfePQEzYE= From: "cvs-commit at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111735 --- Comment #2 from GCC Commits --- The master branch has been updated by David Faust : https://gcc.gnu.org/g:1502d724df85163b14b04e8f67072ca88eac411d commit r14-6716-g1502d724df85163b14b04e8f67072ca88eac411d Author: David Faust 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=3D0, 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_typ= e 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.=