aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-07-03 11:58:49 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2019-07-03 11:58:49 +0000
commite157be919b83177d57666234cd19f6b042140ac1 (patch)
tree7988c6cd3932462406ec6daf62d813ae98924ce0
parent6235b0788c9bc126993067d19c923fdb05be4ed4 (diff)
downloadgcc-e157be919b83177d57666234cd19f6b042140ac1.zip
gcc-e157be919b83177d57666234cd19f6b042140ac1.tar.gz
gcc-e157be919b83177d57666234cd19f6b042140ac1.tar.bz2
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: r273002
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dwarf2out.c1
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gnat.dg/specs/debug1.ads18
4 files changed, 28 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 77d1f60..154e336 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * dwarf2out.c (add_scalar_info): Add back refererence to existing DIE
+ if it has the DW_AT_data_member_location attribute.
+
2019-07-03 Richard Biener <rguenther@suse.de>
* gimple-pretty-print.c (dump_ternary_rhs): Fix BIT_INSERT_EXPR
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 7fa8b05..6e82802 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 d552112..656b589 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2019-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/debug1.ads: New test.
+
2019-07-03 Martin Liska <mliska@suse.cz>
PR tree-optimization/90892
diff --git a/gcc/testsuite/gnat.dg/specs/debug1.ads b/gcc/testsuite/gnat.dg/specs/debug1.ads
new file mode 100644
index 0000000..f94b42a
--- /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 } }