]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add function part to a same comdat group (PR ipa/80212).
authorMartin Liska <mliska@suse.cz>
Fri, 7 Apr 2017 10:36:21 +0000 (12:36 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Fri, 7 Apr 2017 10:36:21 +0000 (10:36 +0000)
2017-04-07  Martin Liska  <mliska@suse.cz>

PR ipa/80212
* g++.dg/ipa/pr80212.C: New test.
2017-04-07  Martin Liska  <mliska@suse.cz>

PR ipa/80212
* ipa-split.c (split_function): Add function part to a same comdat
group.

From-SVN: r246759

gcc/ChangeLog
gcc/ipa-split.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/pr80212.C [new file with mode: 0644]

index e6ad7cefd9284163e0a28fa633ff446e648bb53e..6237a2ce40d34e264aa7f4d6755a4192b0477dd4 100644 (file)
@@ -1,3 +1,9 @@
+2017-04-07  Martin Liska  <mliska@suse.cz>
+
+       PR ipa/80212
+       * ipa-split.c (split_function): Add function part to a same comdat
+       group.
+
 2017-04-07  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/80341
index da3c2c6234460d53f930e0020d6d6c5e3b0c8796..ae1de6f1e63ce59f686e6540edf845998e79f2f6 100644 (file)
@@ -1363,6 +1363,9 @@ split_function (basic_block return_bb, struct split_point *split_point,
   /* Let's take a time profile for splitted function.  */
   node->tp_first_run = cur_node->tp_first_run + 1;
 
+  if (cur_node->same_comdat_group)
+    node->add_to_same_comdat_group (cur_node);
+
   /* For usual cloning it is enough to clear builtin only when signature
      changes.  For partial inlining we however can not expect the part
      of builtin implementation to have same semantic as the whole.  */
index 565485a0218898521813b359bd26ab24ca6ef6ae..43e7bec066c5b789e234cfb69a1c89820fd14fc9 100644 (file)
@@ -1,3 +1,8 @@
+2017-04-07  Martin Liska  <mliska@suse.cz>
+
+       PR ipa/80212
+       * g++.dg/ipa/pr80212.C: New test.
+
 2017-04-07  Thomas Preud'homme  <thomas.preudhomme@arm.com>
 
        * gcc.dg/tree-ssa/pr79800.c: Require c99_runtime.
diff --git a/gcc/testsuite/g++.dg/ipa/pr80212.C b/gcc/testsuite/g++.dg/ipa/pr80212.C
new file mode 100644 (file)
index 0000000..60d3b61
--- /dev/null
@@ -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; }