aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-09-02 22:17:10 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-09-02 20:17:10 +0000
commitc91061e6b0e1a5ce9484decc9aa208ce00a9af57 (patch)
tree2a42e8797aec5db5e1df9c0cc6cd3628837a6036 /gcc
parent2fd0985c70240012e8b0b63a9cafe3b241dcddc9 (diff)
downloadgcc-c91061e6b0e1a5ce9484decc9aa208ce00a9af57.zip
gcc-c91061e6b0e1a5ce9484decc9aa208ce00a9af57.tar.gz
gcc-c91061e6b0e1a5ce9484decc9aa208ce00a9af57.tar.bz2
ipa-split.c (execute_split_functions): Split externally visible functions called once.
* ipa-split.c (execute_split_functions): Split externally visible functions called once. * gcc.dg/tree-ssa/fnsplit-1.c: New testcase. From-SVN: r202185
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-split.c4
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c23
4 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ab141db..359b9d8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index faf7c84..5c3ee4f 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -1537,7 +1537,9 @@ execute_split_functions (void)
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))
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dd53ef6..c01c48c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+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
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c b/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c
new file mode 100644
index 0000000..0c81d92
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c
@@ -0,0 +1,23 @@
+/* { 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" } } */