From: Jan Hubicka Date: Mon, 2 Feb 2015 23:46:31 +0000 (+0100) Subject: ipa-inline.c (early_inliner): Skip inlining only in always_inlined... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d67bce7ce8500397d0f8a8109d6026961f99c87a;p=gcc.git ipa-inline.c (early_inliner): Skip inlining only in always_inlined... * ipa-inline.c (early_inliner): Skip inlining only in always_inlined; if some always_inline was inlined, apply changes before inlining heuristically. * g++.dg/ipa/devirt-37.C: Disable early inlining. From-SVN: r220359 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 467a668d647..9f6e800536f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-02 Jan Hubicka + + * ipa-inline.c (early_inliner): Skip inlining only in always_inlined; + if some always_inline was inlined, apply changes before inlining + heuristically. + 2015-02-02 David Malcolm PR jit/64810 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index be228907400..d9ab56a3e22 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -2528,7 +2528,9 @@ early_inliner (function *fun) cycles of edges to be always inlined in the callgraph. We might want to be smarter and just avoid this type of inlining. */ - || DECL_DISREGARD_INLINE_LIMITS (node->decl)) + || (DECL_DISREGARD_INLINE_LIMITS (node->decl) + && lookup_attribute ("always_inline", + DECL_ATTRIBUTES (node->decl)))) ; else if (lookup_attribute ("flatten", DECL_ATTRIBUTES (node->decl)) != NULL) @@ -2543,6 +2545,18 @@ early_inliner (function *fun) } else { + /* If some always_inline functions was inlined, apply the changes. + This way we will not account always inline into growth limits and + moreover we will inline calls from always inlines that we skipped + previously becuase of conditional above. */ + if (inlined) + { + timevar_push (TV_INTEGRATION); + todo |= optimize_inline_calls (current_function_decl); + inline_update_overall_summary (node); + inlined = false; + timevar_pop (TV_INTEGRATION); + } /* We iterate incremental inlining to get trivial cases of indirect inlining. */ while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1bb46b34182..2039b4c4697 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-02-02 Jan Hubicka + + * g++.dg/ipa/devirt-37.C: Disable early inlining. + 2015-02-02 Christophe Lyon * gcc.target/aarch64/advsimd-intrinsics/arm-neon-ref.h diff --git a/gcc/testsuite/g++.dg/ipa/devirt-37.C b/gcc/testsuite/g++.dg/ipa/devirt-37.C index 0dc4d27bbe2..7e1acdc986c 100644 --- a/gcc/testsuite/g++.dg/ipa/devirt-37.C +++ b/gcc/testsuite/g++.dg/ipa/devirt-37.C @@ -1,4 +1,4 @@ -/* { dg-options "-fpermissive -O2 -fno-indirect-inlining -fno-devirtualize-speculatively -fdump-tree-fre2-details" } */ +/* { dg-options "-fpermissive -O2 -fno-indirect-inlining -fno-devirtualize-speculatively -fdump-tree-fre2-details -fno-early-inlining" } */ #include struct A {virtual void test() {abort ();}}; struct B:A