diff options
author | Pierre-Marie de Rodat <derodat@adacore.com> | 2015-12-21 15:44:32 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2015-12-21 15:44:32 +0000 |
commit | 7c154ecc12c064ba3b154d1d27be6f19dbd0c294 (patch) | |
tree | 2b4f5b779981a2c8031bb382bc23cca7247f9046 /gcc | |
parent | 059fbfa82ba0eeb405af29b96068edd97d26557a (diff) | |
download | gcc-7c154ecc12c064ba3b154d1d27be6f19dbd0c294.zip gcc-7c154ecc12c064ba3b154d1d27be6f19dbd0c294.tar.gz gcc-7c154ecc12c064ba3b154d1d27be6f19dbd0c294.tar.bz2 |
DWARF: allow dynamic data member offsets for inheritance info
An unintended effect of the recently introduced machinery to handle
dynamic data member offsets in variable-length records (when
-fgnat-encodings=minimal) prevented GCC from describing correctly
inheritance information for classes in C++, which is a regression.
This change rectifies this machinery in this case.
gcc/ChangeLog:
* dwarf2out.c (add_data_member_location_attribute): Do not
disable dynamic data member offsets descriptions for TREE_BINFO
members.
From-SVN: r231883
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 22 |
2 files changed, 17 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f37316..c7626ff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-12-21 Pierre-Marie de Rodat <derodat@adacore.com> + + * dwarf2out.c (add_data_member_location_attribute): Do not + disable dynamic data member offsets descriptions for TREE_BINFO + members. + 2015-12-21 Eric Botcazou <ebotcazou@adacore.com> PR tree-optimization/65337 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 320a077..0a5cc54 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -16727,21 +16727,21 @@ add_data_member_location_attribute (dw_die_ref die, { loc_descr = field_byte_offset (decl, ctx, &offset); - /* Data member location evalutation start with the base address on the + /* If loc_descr is available then we know the field offset is dynamic. + However, GDB does not handle dynamic field offsets very well at the + moment. */ + if (loc_descr != NULL && gnat_encodings != DWARF_GNAT_ENCODINGS_MINIMAL) + { + loc_descr = NULL; + offset = 0; + } + + /* Data member location evalutation starts with the base address on the stack. Compute the field offset and add it to this base address. */ - if (loc_descr != NULL) + else if (loc_descr != NULL) add_loc_descr (&loc_descr, new_loc_descr (DW_OP_plus, 0, 0)); } - /* If loc_descr is available then we know the field offset is dynamic. - However, GDB does not handle dynamic field offsets very well at the - moment. */ - if (loc_descr != NULL && gnat_encodings != DWARF_GNAT_ENCODINGS_MINIMAL) - { - loc_descr = NULL; - offset = 0; - } - if (! loc_descr) { if (dwarf_version > 2) |