]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (add_scalar_info): Add back refererence to existing DIE if it has the...
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 3 Jul 2019 12:01:30 +0000 (12:01 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 3 Jul 2019 12:01:30 +0000 (12:01 +0000)
* dwarf2out.c (add_scalar_info): Add back refererence to existing DIE
if it has the DW_AT_data_member_location attribute.

From-SVN: r273003

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/specs/debug1.ads [new file with mode: 0644]

index 8126dcb469f3b8d3f59fb004d360e6fcaa14ed1c..31e404983f347ba8855759ecab96058001746a01 100644 (file)
@@ -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-02  Andrew Stubbs  <ams@codesourcery.com>
 
        Backport from mainline:
index 3ffdc55453c1160e319f130e00593ce4e4dc4dd9..54390ea533f86feb369063ba1ed40c886e88ed9d 100644 (file)
@@ -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);
index 0dadea49eb87de4f02f7a3f3696ee4493c3d8ee2..89bd88d01ec8a07aa5a5be4d4054b3f147de0b3d 100644 (file)
@@ -1,3 +1,7 @@
+2019-07-03  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/specs/debug1.ads: New test.
+
 2019-06-29  Eric Botcazou  <ebotcazou@adacore.com>
 
        * 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 (file)
index 0000000..f94b42a
--- /dev/null
@@ -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 } }