2013-02-05 Jan Hubicka <jh@suse.cz>
- PR tree-optimization/r55789
+ PR tree-optimization/55789
+ * params.def (PARAM_EARLY_INLINER_MAX_ITERATIONS): Drop to 1.
+
+2013-02-05 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/55789
* cgraphclones.c (cgraph_remove_node_and_inline_clones): Remove
the dead call anyway.
DEFPARAM (PARAM_EARLY_INLINER_MAX_ITERATIONS,
"max-early-inliner-iterations",
"The maximum number of nested indirect inlining performed by early inliner",
- 10, 0, 0)
+ 1, 0, 0)
/* Limit on probability of entry BB. */
DEFPARAM (PARAM_COMDAT_SHARING_PROBABILITY,
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-inline --param max-early-inliner-iterations=1" } */
+/* { dg-add-options bind_pic_locally } */
+
+namespace std {
+ extern "C" void puts(const char *s);
+}
+
+template <class T, class E> void
+foreach (T b, T e, void (*ptr)(E))
+{
+ for (; b != e; b++)
+ ptr(*b);
+}
+
+void
+inline_me (char *x)
+{
+ std::puts(x);
+}
+
+static void
+inline_me_too (char *x)
+{
+ std::puts(x);
+}
+
+int main(int argc, char **argv)
+{
+ foreach (argv, argv + argc, inline_me);
+ foreach (argv, argv + argc, inline_me_too);
+}
+
+/* { dg-final { scan-tree-dump-times "Considering void inline_me\\(" 1 "inline"} } */
+/* { dg-final { scan-tree-dump-times "Considering void inline_me_too\\(" 1 "inline"} } */
+/* { dg-final { cleanup-tree-dump "einline" } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-inline --param max-early-inliner-iterations=1" } */
+/* { dg-add-options bind_pic_locally } */
+
+namespace std {
+ extern "C" void puts(const char *s);
+}
+
+template <class T, class E> void
+foreach (T b, T e, E ptr)
+{
+ for (; b != e; b++)
+ ptr(*b);
+}
+
+void
+inline_me (char *x)
+{
+ std::puts(x);
+}
+
+static void
+inline_me_too (char *x)
+{
+ std::puts(x);
+}
+
+int main(int argc, char **argv)
+{
+ foreach (argv, argv + argc, inline_me);
+ foreach (argv, argv + argc, inline_me_too);
+}
+
+/* { dg-final { scan-ipa-dump-times "Considering void inline_me\\(" 1 "inline"} } */
+/* { dg-final { scan-ipa-dump-times "Considering void inline_me_too\\(" 1 "inline"} } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-inline --param max-early-inliner-iterations=1" } */
+/* { dg-add-options bind_pic_locally } */
+
+#include <algorithm>
+
+void foo(const char *s);
+
+void
+inline_me (char *x)
+{
+ foo(x);
+}
+
+static void
+inline_me_too (char *x)
+{
+ foo(x);
+}
+
+int main(int argc, char **argv)
+{
+ std::for_each (argv, argv + argc, inline_me);
+ std::for_each (argv, argv + argc, inline_me_too);
+}
+
+/* { dg-final { scan-ipa-dump-times "Considering void inline_me\\(" 1 "inline"} } */
+/* { dg-final { scan-ipa-dump-times "Considering void inline_me_too\\(" 1 "inline"} } */
+/* { dg-final { cleanup-tree-dump "inline" } } */
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-einline" } */
+/* { dg-options "-O2 -fdump-tree-einline --param max-early-inliner-iterations=3" } */
/* { dg-add-options bind_pic_locally } */
namespace std {
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-einline" } */
+/* { dg-options "-O2 -fdump-tree-einline --param max-early-inliner-iterations=3" } */
/* { dg-add-options bind_pic_locally } */
namespace std {
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-einline" } */
+/* { dg-options "-O2 -fdump-tree-einline --param max-early-inliner-iterations=3" } */
/* { dg-add-options bind_pic_locally } */
#include <algorithm>