From: Eric Botcazou Date: Wed, 3 Jul 2019 12:01:30 +0000 (+0000) Subject: dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the... X-Git-Tag: releases/gcc-9.2.0~176 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=669c0e314c38ca3da31ce7f716fa9061611240e8;p=thirdparty%2Fgcc.git dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the DW_AT_data_member_location... * dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the DW_AT_data_member_location attribute. From-SVN: r273003 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8126dcb469f3..31e404983f34 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-07-03 Eric Botcazou + + * dwarf2out.c (add_scalar_info): Add back refererence to existing DIE + if it has the DW_AT_data_member_location attribute. + 2019-07-02 Andrew Stubbs Backport from mainline: diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 3ffdc55453c1..54390ea533f8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -20845,6 +20845,7 @@ add_scalar_info (dw_die_ref die, enum dwarf_attribute attr, tree value, if (decl_die != NULL) { 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)) { add_AT_die_ref (die, attr, decl_die); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0dadea49eb87..89bd88d01ec8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-07-03 Eric Botcazou + + * gnat.dg/specs/debug1.ads: New test. + 2019-06-29 Eric Botcazou * gnat.dg/specs/array5.ads: New test. diff --git a/gcc/testsuite/gnat.dg/specs/debug1.ads b/gcc/testsuite/gnat.dg/specs/debug1.ads new file mode 100644 index 000000000000..f94b42aa76c1 --- /dev/null +++ b/gcc/testsuite/gnat.dg/specs/debug1.ads @@ -0,0 +1,18 @@ +-- { dg-do compile } +-- { dg-options "-cargs -g -dA -fgnat-encodings=minimal -margs" } + +package Debug1 is + + type Index_T is new Positive range 1 .. 128; + + type Array_Type is array (Index_T range <>) of Integer; + + type Record_Type (N : Index_T := 16) is record + A : Array_Type (1 .. N); + end record; + + R : Record_Type; + +end Debug1; + +-- { dg-final { scan-assembler-times "DW_AT_upper_bound" 4 } }