aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-04-06 08:51:23 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-04-06 08:51:23 +0000
commitd7d1d041aedeeb19cc16c718ec517aaeac81c10e (patch)
tree2e899a35ae492409cf1aea6ceba40b33bc2febab /gcc/testsuite/gcc.dg/tree-ssa/inline-8.c
parent2feb95f7d8c340e425d977a660d7b6d4c3282792 (diff)
downloadgcc-d7d1d041aedeeb19cc16c718ec517aaeac81c10e.zip
gcc-d7d1d041aedeeb19cc16c718ec517aaeac81c10e.tar.gz
gcc-d7d1d041aedeeb19cc16c718ec517aaeac81c10e.tar.bz2
re PR middle-end/47663 (Very simple wrapper not inlined)
2011-04-06 Richard Guenther <rguenther@suse.de> PR tree-optimization/47663 * cgraph.h (struct cgraph_edge): Add call_stmt_size and call_stmt_time fields. (cgraph_edge_inlinable_p): Declare. (cgraph_edge_recursive_p): New inline function. * cgraph.c (cgraph_create_edge_1): Initialize call_stmt_size. (cgraph_clone_edge): Copy it. * ipa-inline.c (cgraph_estimate_edge_time): New function. Account for call stmt time. (cgraph_estimate_time_after_inlining): Take edge argument. (cgraph_estimate_edge_growth): Account call stmt size. (cgraph_estimate_size_after_inlining): Take edge argument. (cgraph_mark_inline_edge): Adjust. (cgraph_check_inline_limits): Likewise. (cgraph_recursive_inlining_p): Remove. (cgraph_edge_badness): Use cgraph_edge_recursive_p. (cgraph_decide_recursive_inlining): Take edge argument and adjust. (cgraph_decide_inlining_of_small_functions): Do not avoid diags for recursive inlining here. (cgraph_flatten): Adjust. (cgraph_decide_inlining_incrementally): Likewise. (estimate_function_body_sizes): Remove call cost handling. (compute_inline_parameters): Initialize caller edge call costs. (cgraph_estimate_edge_growth): New function. (cgraph_estimate_growth): Use it. (cgraph_edge_badness): Likewise. (cgraph_check_inline_limits): Take an edge argument. (cgraph_decide_inlining_of_small_functions): Adjust. (cgraph_decide_inlining): Likewise. * tree-inline.c (estimate_num_insns): Only account for call return value if it is used. (expand_call_inline): Avoid diagnostics on recursive inline functions here. * lto-cgraph.c (lto_output_edge): Output edge call costs. (input_edge): Input edge call costs. * gcc.dg/tree-ssa/inline-8.c: New testcase. From-SVN: r172023
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/inline-8.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/inline-8.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c b/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c
new file mode 100644
index 0000000..3215473
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/inline-8.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O -finline-small-functions --param early-inlining-insns=0 -fdump-tree-einline" } */
+
+int foo0();
+void bar0() { foo0(); }
+void foobar0() { bar0(); }
+
+void foo1();
+void bar1() { foo1(); }
+void foobar1() { bar1(); }
+
+#if 0
+int foo2();
+int bar2() { return foo2(); }
+/* The size estimate fails to see that inlining the call statement in bar2
+ will make its lhs dead. */
+void foobar2() { bar2(); }
+#endif
+
+int foo3();
+int bar3() { return foo3(); }
+int foobar3() { return bar3(); }
+
+int bar4() { return 0; }
+void foobar4() { bar4(); }
+
+int bar5() { return 0; }
+int foobar5() { return bar5(); }
+
+/* { dg-final { scan-tree-dump-times "Inlining" 5 "einline" } } */
+/* { dg-final { cleanup-tree-dump "einline" } } */