diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2021-08-16 15:26:22 +0200 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2021-08-16 15:27:42 +0200 |
commit | be024a1285840bf2fc47fcbde32375468a92ce05 (patch) | |
tree | 3e27687ab331c7f8981729eeb517eb509b4500dd /gcc | |
parent | e660441f94f2ca2ca1bd63c922c6a43737c2259e (diff) | |
download | gcc-be024a1285840bf2fc47fcbde32375468a92ce05.zip gcc-be024a1285840bf2fc47fcbde32375468a92ce05.tar.gz gcc-be024a1285840bf2fc47fcbde32375468a92ce05.tar.bz2 |
Fix regression in debug info for Ada with DWARF 5
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/dwarf2out.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 4bcd331..ba0a6d6 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -21253,6 +21253,7 @@ add_scalar_info (dw_die_ref die, enum dwarf_attribute attr, tree value, { 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); |