+2009-12-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/42386
+ * ipa.c (function_and_variable_visibility): Clear same_comdat_group
+ links of DECL_EXTERNAL nodes.
+
2009-12-17 Sandra Loosemore <sandra@codesourcery.com>
* doc/rtl.texi (Vector Operations): Clarify vec_select result mode.
happy. Clear the flag here to avoid confusion in middle-end. */
if (DECL_COMDAT (node->decl) && !TREE_PUBLIC (node->decl))
DECL_COMDAT (node->decl) = 0;
+ /* For external decls stop tracking same_comdat_group, it doesn't matter
+ what comdat group they are in when they won't be emitted in this TU,
+ and simplifies later passes. */
+ if (node->same_comdat_group && DECL_EXTERNAL (node->decl))
+ {
+ struct cgraph_node *n = node, *next;
+ do
+ {
+ /* If at least one of same comdat group functions is external,
+ all of them have to be, otherwise it is a front-end bug. */
+ gcc_assert (DECL_EXTERNAL (n->decl));
+ next = n->same_comdat_group;
+ n->same_comdat_group = NULL;
+ n = next;
+ }
+ while (n != node);
+ }
gcc_assert ((!DECL_WEAK (node->decl) && !DECL_COMDAT (node->decl))
|| TREE_PUBLIC (node->decl) || DECL_EXTERNAL (node->decl));
if (cgraph_externally_visible_p (node, whole_program))
+2009-12-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/42386
+ * g++.dg/opt/dtor3.C: New test.
+
2009-12-17 Arnaud Charlet <charlet@adacore.com>
* ada/acats/run_all.sh: Strip comments from norun.lst
--- /dev/null
+// PR c++/42386
+// { dg-do compile }
+// { dg-options "-O2" }
+# 1 "A.h" 1
+#pragma interface
+struct D { virtual bool d () const; };
+struct E { virtual ~E (); virtual void *e () const = 0; };
+struct A : public D, public E { ~A () {} };
+# 5 "dtor3.C" 1
+struct F : public A { void *f () const; void *e () const; };
+void *F::e () const { return __null; }