Commit 087fa34b by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/43801 (error: function causes a section type conflict…

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
parent 0287000a
2010-06-29 Jakub Jelinek <jakub@redhat.com> 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 PR debug/44668
* dwarf2out.c (add_accessibility_attribute): New function. * dwarf2out.c (add_accessibility_attribute): New function.
(gen_subprogram_die, gen_variable_die, gen_field_die): Use it (gen_subprogram_die, gen_variable_die, gen_field_die): Use it
......
...@@ -2217,6 +2217,8 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node, ...@@ -2217,6 +2217,8 @@ cgraph_create_virtual_clone (struct cgraph_node *old_node,
??? We cannot use COMDAT linkage because there is no ??? We cannot use COMDAT linkage because there is no
ABI support for this. */ ABI support for this. */
DECL_EXTERNAL (new_node->decl) = 0; 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; DECL_COMDAT_GROUP (new_node->decl) = 0;
TREE_PUBLIC (new_node->decl) = 0; TREE_PUBLIC (new_node->decl) = 0;
DECL_COMDAT (new_node->decl) = 0; DECL_COMDAT (new_node->decl) = 0;
......
2010-06-29 Jakub Jelinek <jakub@redhat.com> 2010-06-29 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/43801
* g++.dg/torture/pr43801.C: New test.
PR debug/44668 PR debug/44668
* g++.dg/debug/dwarf2/accessibility1.C: New test. * g++.dg/debug/dwarf2/accessibility1.C: New test.
......
// 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 ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment