Fix a few DWARF bugs with -fgnat-encodings=minimal
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Tue, 5 May 2020 10:35:00 +0000 (12:35 +0200)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 7 May 2020 08:54:09 +0000 (10:54 +0200)
commit834e660ea8e0fbf26d937aa641aacaeeff7c5d60
treea96ba1c5e5be9ae1a75c714ed4d5aee876af2603
parentb24fc8a692e3f2a8bd89d7ccb230ad3c72323e73
Fix a few DWARF bugs with -fgnat-encodings=minimal

The -fgnat-encodings=minimal switch tells the compiler to generate mostly
pure DWARF for the GNAT compiler and it contains some bugs related to
discriminated record types with variant part.

* dwarf2out.c (add_data_member_location_attribute): Account for
the variant part offset in the computation of the data bit offset.
(add_bit_offset_attribute): Remove CTX parameter.  Pass a new
context in the call to field_byte_offset.
(gen_field_die): Adjust call to add_bit_offset_attribute and
remove confusing assertion.
(analyze_variant_discr): Deal with boolean subtypes.
gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/debug16.adb [new file with mode: 0644]