re PR debug/88046 (ICE in add_data_member_location_attribute at gcc/dwarf2out.c:19237...
authorRichard Biener <rguenther@suse.de>
Tue, 15 Jan 2019 16:06:42 +0000 (16:06 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 15 Jan 2019 16:06:42 +0000 (16:06 +0000)
2019-01-15  Richard Biener  <rguenther@suse.de>

PR debug/88046
* dwarf2out.c (gen_member_die): Do not generate inheritance
DIEs late.

* g++.dg/lto/pr88046_0.C: New testcase.

From-SVN: r267940

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/pr88046_0.C [new file with mode: 0644]

index 14f0730a0388bd28eb709963371db5952e9ce21e..c3b9f14de520dc215cd36643c6a91d35b0e83ef4 100644 (file)
@@ -1,3 +1,9 @@
+2019-01-15  Richard Biener  <rguenther@suse.de>
+
+       PR debug/88046
+       * dwarf2out.c (gen_member_die): Do not generate inheritance
+       DIEs late.
+
 2019-01-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/88855
index 8b4f7bc95bf297156c0813880ae1cd07b59f9791..a1b5a5eaf19000452f3f03e48c3874d9aef9b494 100644 (file)
@@ -25046,7 +25046,7 @@ gen_member_die (tree type, dw_die_ref context_die)
      the TREE node representing the appropriate (containing) type.  */
 
   /* First output info about the base classes.  */
-  if (binfo)
+  if (binfo && early_dwarf)
     {
       vec<tree, va_gc> *accesses = BINFO_BASE_ACCESSES (binfo);
       int i;
index a5cfa7f6291f0ae80b00b5834de6ebee2d796b71..1b0689d5ea20a36842222579662dfe899b20e1ab 100644 (file)
@@ -1,3 +1,8 @@
+2019-01-15  Richard Biener  <rguenther@suse.de>
+
+       PR debug/88046
+       * g++.dg/lto/pr88046_0.C: New testcase.
+
 2019-01-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/88855
diff --git a/gcc/testsuite/g++.dg/lto/pr88046_0.C b/gcc/testsuite/g++.dg/lto/pr88046_0.C
new file mode 100644 (file)
index 0000000..a254dd0
--- /dev/null
@@ -0,0 +1,14 @@
+// { dg-lto-do link }
+// { dg-lto-options { { -O2 -fPIC -flto } } }
+// { dg-extra-ld-options "-shared -g" }
+
+class a {};
+class b : virtual a {
+public:
+    void operator<<(bool);
+};
+void c() try {
+    b d;
+    d << "";
+} catch (int) {
+}