PR tree-optimization/43801
* cgraph.c (cgraph_create_virtual_clone): Clear DECL_SECTION_NAME
if old_decl was DECL_ONE_ONLY.
* g++.dg/torture/pr43801.C: New test.
From-SVN: r161564
2010-06-29 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/43801
+ * cgraph.c (cgraph_create_virtual_clone): Clear DECL_SECTION_NAME
+ if old_decl was DECL_ONE_ONLY.
+
PR debug/44668
* dwarf2out.c (add_accessibility_attribute): New function.
(gen_subprogram_die, gen_variable_die, gen_field_die): Use it
??? We cannot use COMDAT linkage because there is no
ABI support for this. */
DECL_EXTERNAL (new_node->decl) = 0;
+ if (DECL_ONE_ONLY (old_decl))
+ DECL_SECTION_NAME (new_node->decl) = NULL;
DECL_COMDAT_GROUP (new_node->decl) = 0;
TREE_PUBLIC (new_node->decl) = 0;
DECL_COMDAT (new_node->decl) = 0;
2010-06-29 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/43801
+ * g++.dg/torture/pr43801.C: New test.
+
PR debug/44668
* g++.dg/debug/dwarf2/accessibility1.C: New test.
--- /dev/null
+// PR tree-optimization/43801
+// { dg-do compile }
+// { dg-options "-fipa-cp -fipa-cp-clone" }
+
+struct A
+{
+ virtual void f (int);
+};
+struct B : virtual A
+{
+ virtual void f (int i) { if (i) A::f(0); }
+};
+struct C : virtual B
+{
+ virtual void f (int) { B::f(0); }
+};
+
+void
+foo ()
+{
+ C ();
+}