OSDN Git Service

* ipa-inline.c (cgraph_mark_inline): Assert that we never inline
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jun 2007 10:31:55 +0000 (10:31 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 26 Jun 2007 10:31:55 +0000 (10:31 +0000)
uninlinable call.
(cgraph_decide_inlining_of_small_function, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally): Move uninlinability checks to
places other call site specific checks are performed.

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

gcc/ChangeLog
gcc/ipa-inline.c

index dcaa66b..3684534 100644 (file)
@@ -1,3 +1,11 @@
+2007-06-25  Jan Hubicka  <jh@suse.cz>
+
+       * ipa-inline.c (cgraph_mark_inline): Assert that we never inline
+       uninlinable call.
+       (cgraph_decide_inlining_of_small_function, cgraph_decide_inlining,
+       cgraph_decide_inlining_incrementally): Move uninlinability checks to
+       places other call site specific checks are performed.
+
 2007-06-25  Andrew Pinski  <andrew_pinski@playstation.sony.com>
 
        PR tree-opt/32421
index c682f86..1aacce4 100644 (file)
@@ -289,13 +289,13 @@ cgraph_mark_inline (struct cgraph_edge *edge)
   struct cgraph_node *what = edge->callee;
   struct cgraph_edge *e, *next;
 
+  gcc_assert (!CALL_CANNOT_INLINE_P (edge->call_stmt));
   /* Look for all calls, mark them inline and clone recursively
      all inlined functions.  */
   for (e = what->callers; e; e = next)
     {
       next = e->next_caller;
-      if (e->caller == to && e->inline_failed
-         && !CALL_CANNOT_INLINE_P (e->call_stmt))
+      if (e->caller == to && e->inline_failed)
        {
           cgraph_mark_inline_edge (e, true);
          if (e == edge)
@@ -884,7 +884,7 @@ cgraph_decide_inlining_of_small_functions (void)
        }
       gcc_assert (edge->aux);
       edge->aux = NULL;
-      if (!edge->inline_failed || CALL_CANNOT_INLINE_P (edge->call_stmt))
+      if (!edge->inline_failed)
        continue;
 
       /* When not having profile info ready we don't weight by any way the
@@ -950,8 +950,9 @@ cgraph_decide_inlining_of_small_functions (void)
       else
        {
          struct cgraph_node *callee;
-         if (!cgraph_check_inline_limits (edge->caller, edge->callee,
-                                          &edge->inline_failed, true))
+         if (CALL_CANNOT_INLINE_P (edge->call_stmt)
+             || !cgraph_check_inline_limits (edge->caller, edge->callee,
+                                             &edge->inline_failed, true))
            {
              if (dump_file)
                fprintf (dump_file, " Not inlining into %s:%s.\n",
@@ -1116,6 +1117,7 @@ cgraph_decide_inlining (void)
 
          if (node->callers && !node->callers->next_caller && !node->needed
              && node->local.inlinable && node->callers->inline_failed
+             && !CALL_CANNOT_INLINE_P (node->callers->call_stmt)
              && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl))
            {
              if (dump_file)
@@ -1278,6 +1280,8 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
       if (!e->callee->local.disregard_inline_limits
          && (mode != INLINE_ALL || !e->callee->local.inlinable))
        continue;
+      if (CALL_CANNOT_INLINE_P (e->call_stmt))
+       continue;
       /* When the edge is already inlined, we just need to recurse into
         it in order to fully flatten the leaves.  */
       if (!e->inline_failed && mode == INLINE_ALL)
@@ -1375,7 +1379,8 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
            continue;
          }
        if (!cgraph_check_inline_limits (node, e->callee, &e->inline_failed,
-                                       false))
+                                       false)
+           || CALL_CANNOT_INLINE_P (e->call_stmt))
          {
            if (dump_file)
              {