aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-09-07 23:26:34 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-09-07 21:26:34 +0000
commitf27e50db1ab5c90adf4ce77902a4e5783196d7d7 (patch)
tree9387799cf71631d4729cdd22bf7ff6259166a129 /gcc/ipa-inline.c
parenta0766cdbb98bcbfb85f977930d3cead1f02f292a (diff)
downloadgcc-f27e50db1ab5c90adf4ce77902a4e5783196d7d7.zip
gcc-f27e50db1ab5c90adf4ce77902a4e5783196d7d7.tar.gz
gcc-f27e50db1ab5c90adf4ce77902a4e5783196d7d7.tar.bz2
tree-inline.c (tree_inlinable_function_p): Do not test DECL_REPLACEABLE_P.
* tree-inline.c (tree_inlinable_function_p): Do not test DECL_REPLACEABLE_P. * ipa-inline.c (cgraph_default_inline_p, update_caller_keys, update_callee_keys, cgraph_decide_inlining): Test function availability. * cif-code.def (OVERWRITABLE): New code. From-SVN: r163972
Diffstat (limited to 'gcc/ipa-inline.c')
-rw-r--r--gcc/ipa-inline.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c
index 1604d07..964d03b 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -480,13 +480,19 @@ cgraph_default_inline_p (struct cgraph_node *n, cgraph_inline_failed_t *reason)
*reason = CIF_FUNCTION_NOT_INLINE_CANDIDATE;
return false;
}
-
if (!n->analyzed)
{
if (reason)
*reason = CIF_BODY_NOT_AVAILABLE;
return false;
}
+ if (cgraph_function_body_availability (n) <= AVAIL_OVERWRITABLE)
+ {
+ if (reason)
+ *reason = CIF_OVERWRITABLE;
+ return false;
+ }
+
if (DECL_DECLARED_INLINE_P (decl))
{
@@ -697,6 +703,7 @@ update_caller_keys (fibheap_t heap, struct cgraph_node *node,
cgraph_inline_failed_t failed_reason;
if (!node->local.inlinable
+ || cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE
|| node->global.inlined_to)
return;
if (!bitmap_set_bit (updated_nodes, node->uid))
@@ -749,6 +756,7 @@ update_callee_keys (fibheap_t heap, struct cgraph_node *node,
{
if (e->inline_failed
&& e->callee->local.inlinable
+ && cgraph_function_body_availability (e->callee) >= AVAIL_AVAILABLE
&& !bitmap_bit_p (updated_nodes, e->callee->uid))
{
node->global.estimated_growth = INT_MIN;
@@ -1499,6 +1507,7 @@ cgraph_decide_inlining (void)
&& !node->callers->next_caller
&& cgraph_will_be_removed_from_program_if_no_direct_calls (node)
&& node->local.inlinable
+ && cgraph_function_body_availability (node) >= AVAIL_AVAILABLE
&& node->callers->inline_failed
&& node->callers->caller != node
&& node->callers->caller->global.inlined_to != node