Add function part to a same comdat group (PR ipa/80212).

2017-04-11  Martin Liska  <mliska@suse.cz>

	PR ipa/80212
	* cgraph.c (cgraph_node::dump): Dump calls_comdat_local.
	* ipa-split.c (split_function): Create a local comdat symbol
	if caller is in a comdat group.
2017-04-11  Martin Liska  <mliska@suse.cz>

	PR ipa/80212
	* g++.dg/ipa/pr80212.C: New test.

From-SVN: r246848
This commit is contained in:
Martin Liska 2017-04-11 18:38:19 +02:00 committed by Martin Liska
parent 58928b3589
commit c6cf6ef7c0
5 changed files with 41 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2017-04-11 Martin Liska <mliska@suse.cz>
PR ipa/80212
* cgraph.c (cgraph_node::dump): Dump calls_comdat_local.
* ipa-split.c (split_function): Create a local comdat symbol
if caller is in a comdat group.
2017-04-11 Martin Liska <mliska@suse.cz>
PR ipa/80212

View file

@ -2123,6 +2123,8 @@ cgraph_node::dump (FILE *f)
fprintf (f, " only_called_at_exit");
if (tm_clone)
fprintf (f, " tm_clone");
if (calls_comdat_local)
fprintf (f, " calls_comdat_local");
if (icf_merged)
fprintf (f, " icf_merged");
if (merged_comdat)

View file

@ -1360,6 +1360,15 @@ split_function (basic_block return_bb, struct split_point *split_point,
node->split_part = true;
if (cur_node->same_comdat_group)
{
/* TODO: call is versionable if we make sure that all
callers are inside of a comdat group. */
cur_node->calls_comdat_local = 1;
node->add_to_same_comdat_group (cur_node);
}
/* Let's take a time profile for splitted function. */
node->tp_first_run = cur_node->tp_first_run + 1;

View file

@ -1,3 +1,8 @@
2017-04-11 Martin Liska <mliska@suse.cz>
PR ipa/80212
* g++.dg/ipa/pr80212.C: New test.
2017-04-11 Martin Sebor <msebor@redhat.com>
PR middle-end/80364

View file

@ -0,0 +1,18 @@
// PR ipa/80212
// { dg-options "-O2 --param partial-inlining-entry-probability=403796683 -fno-early-inlining" }
struct b
{
virtual b *c () const;
};
struct d : virtual b
{
};
struct e : d
{
e *
c () const
{
}
};
main () { e a; }