aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/module.cc
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2024-04-11 11:18:55 -0700
committerDavid Faust <david.faust@oracle.com>2024-04-11 15:19:13 -0700
commitf079d69d7b1338522562516537d96e9e1285c95e (patch)
treedb75d89e5644f12e741a7da96cfa3e160608c2e7 /gcc/cp/module.cc
parent33f83d3cd84f9876180a2e2a9d1ea082debdaa37 (diff)
downloadgcc-f079d69d7b1338522562516537d96e9e1285c95e.zip
gcc-f079d69d7b1338522562516537d96e9e1285c95e.tar.gz
gcc-f079d69d7b1338522562516537d96e9e1285c95e.tar.bz2
btf: emit non-representable bitfield as void
This patch fixes an issue with mangled BTF that could occur when a struct type contains a bitfield member which cannot be represented in BTF. It is undefined what should happen in such cases, but we can at least do something reasonable. Commit 936dd627cd9 "btf: do not skip members of data type with type id BTF_VOID_TYPEID" made a similar change for un-representable non-bitfield members, but had an unintended side-effect of mangling BTF for un-representable bitfields: the struct (or union) would account for the offending bitfield in its member count but the bitfield member itself was not emitted, making the member count incorrect. This change ensures that non-representable bitfield members of struct and union types are always emitted with BTF_VOID_TYPEID. This avoids corrupting the BTF information for the entire struct or union type. gcc/ * btfout.cc (btf_asm_sou_member): Always emit non-representable bitfield members as having 'void' type. Refactor slightly. gcc/testsuite/ * gcc.dg/debug/btf/btf-bitfields-4.c: Add two new checks.
Diffstat (limited to 'gcc/cp/module.cc')
0 files changed, 0 insertions, 0 deletions