+2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR middle-end/87916
+ * cgraphclones.c (duplicate_thunk_for_node): Also set DECL_IGNORED_P.
+
2018-11-08 David Malcolm <dmalcolm@redhat.com>
* cgraph.c: Include "selftest.h".
"artificial_thunk");
SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl));
+ /* We need to force DECL_IGNORED_P because the new thunk is created after
+ early debug was run. */
+ DECL_IGNORED_P (new_decl) = 1;
+
new_thunk = cgraph_node::create (new_decl);
set_new_clone_decl_and_node_flags (new_thunk);
new_thunk->definition = true;
+2018-11-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * g++.dg/other/pr87916.C: New test.
+
2018-11-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/87929
--- /dev/null
+// PR middle-end/87916
+// Testcase by Martin Liška <marxin@gcc.gnu.org>
+
+// { dg-do compile }
+// { dg-options "-O2 -g" }
+// { dg-additional-options "-fPIC" { target fpic } }
+
+struct a {
+ virtual ~a();
+};
+template <typename b> class c {
+public:
+ class d {
+ public:
+ d(c);
+ b *operator->();
+ };
+};
+int e, f;
+class g {
+public:
+ class h {
+ public:
+ virtual void j(g &, int &, bool) = 0;
+ };
+ c<h> k();
+ int *l();
+ int *m();
+};
+int *g::l() try {
+ for (c<h>::d i(k());;)
+ i->j(*this, e, true);
+} catch (int) {
+ return 0;
+}
+int *g::m() try {
+ for (c<h>::d i(k());;)
+ i->j(*this, f, false);
+} catch (int) {
+ return 0;
+}
+struct n : a, g::h {
+ void o();
+ void j(g &, int &, bool) { o(); }
+};