* ipa-split.c (execute_split_functions): Split externally visible
functions called once.
* gcc.dg/tree-ssa/fnsplit-1.c: New testcase.
From-SVN: r202185
+2013-09-02 Jan Hubicka <jh@suse.cz>
+
+ * ipa-split.c (execute_split_functions): Split externally visible
+ functions called once.
+
2013-09-02 Martin Jambor <mjambor@suse.cz>
PR ipa/58106
Note that we are not completely conservative about disqualifying functions
called once. It is possible that the caller is called more then once and
then inlining would still benefit. */
- if ((!node->callers || !node->callers->next_caller)
+ if ((!node->callers
+ /* Local functions called once will be completely inlined most of time. */
+ || (!node->callers->next_caller && node->local.local))
&& !node->symbol.address_taken
&& (!flag_lto || !node->symbol.externally_visible))
{
+2013-09-02 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/tree-ssa/fnsplit-1.c: New testcase.
+
2013-09-02 Martin Jambor <mjambor@suse.cz>
PR ipa/58106
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fnsplit" } */
+#include <stdio.h>
+int a[1000];
+
+void
+t(int a)
+{
+ if (a)
+ printf ("I Am Completely Operational,"),
+ printf ("And All My Circuits Are Functioning Perfectly\n");
+}
+int
+main(void)
+{
+ int i;
+ for (i = 0; i < 1000; i++)
+ t(a[i]);
+ return 0;
+}
+/* { dg-final { scan-tree-dump-times "Splitting function at:" 1 "fnsplit"} } */
+
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */