add_scalar_info can directly generate a reference to an existing DIE for a
scalar attribute, e.g the upper bound of a VLA, but it does so only if this
existing DIE has a location or is a constant:
if (get_AT (decl_die, DW_AT_location)
|| get_AT (decl_die, DW_AT_data_member_location)
|| get_AT (decl_die, DW_AT_const_value))
Now, in DWARF 5, members of a structure that are bitfields no longer have a
DW_AT_data_member_location but a DW_AT_data_bit_offset attribute instead, so
the condition is bypassed.
gcc/
* dwarf2out.c (add_scalar_info): Deal with DW_AT_data_bit_offset.
{
if (get_AT (decl_die, DW_AT_location)
|| get_AT (decl_die, DW_AT_data_member_location)
+ || get_AT (decl_die, DW_AT_data_bit_offset)
|| get_AT (decl_die, DW_AT_const_value))
{
add_AT_die_ref (die, attr, decl_die);