re PR tree-optimization/43801 (error: function causes a section type conflict with -fipa-cp -fipa-cp-clone)

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
This commit is contained in:
Jakub Jelinek 2010-06-29 21:46:05 +02:00 committed by Jakub Jelinek
parent 0287000a9f
commit 087fa34bad
4 changed files with 31 additions and 0 deletions

View File

@ -1,5 +1,9 @@
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

View File

@ -2217,6 +2217,8 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
??? 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;

View File

@ -1,5 +1,8 @@
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.

View File

@ -0,0 +1,22 @@
// 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 ();
}