* tree-inline.c (tree_inlinable_function_p): Do not test DECL_REPLACEABLE_P.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Sep 2010 21:26:34 +0000 (21:26 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 Sep 2010 21:26:34 +0000 (21:26 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163972 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cif-code.def
gcc/ipa-inline.c
gcc/tree-inline.c

index 33c56d9..3f027bd 100644 (file)
@@ -1,3 +1,10 @@
+2010-09-07  Jan Hubicka  <jh@suse.cz>
+
+       * 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.
+
 2010-09-07  H.J. Lu  <hjl.tools@gmail.com>
            Jack Howarth <howarth@bromo.med.uc.edu>
 
index 4898486..fda104a 100644 (file)
@@ -88,3 +88,5 @@ DEFCIFCODE(ORIGINALLY_INDIRECT_CALL,
 /* Ths edge represents an indirect edge with a yet-undetermined callee .  */
 DEFCIFCODE(INDIRECT_UNKNOWN_CALL,
           N_("indirect function call with a yet undetermined callee"))
+
+DEFCIFCODE(OVERWRITABLE, N_("function body can be overwriten at linktime"))
index 1604d07..964d03b 100644 (file)
@@ -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
index 3784bc5..362211a 100644 (file)
@@ -3197,12 +3197,6 @@ tree_inlinable_function_p (tree fn)
       inlinable = false;
     }
 
-  /* Don't auto-inline anything that might not be bound within
-     this unit of translation.  */
-  else if (!DECL_DECLARED_INLINE_P (fn)
-          && DECL_REPLACEABLE_P (fn))
-    inlinable = false;
-
   else if (!function_attribute_inlinable_p (fn))
     {
       if (do_warning)