This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix CALL_CANNOT_INLINE checks


Hi,
this patch moves around the CALL_CANNOT_INLINE checks to places other
per-call site checks are performed.
It also removes one bogues check in cgraph_mark_inline that is too late,
the patch seems to fix tramp3d compilation.

Bootstrapped/regtested i686-linux, comitted.
Honza

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 126014)
+++ ChangeLog	(working copy)
@@ -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: ipa-inline.c
===================================================================
--- ipa-inline.c	(revision 126014)
+++ ipa-inline.c	(working copy)
@@ -289,13 +289,13 @@ cgraph_mark_inline (struct cgraph_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_function
 	}
       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_function
       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 (st
       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 (st
 	    continue;
 	  }
 	if (!cgraph_check_inline_limits (node, e->callee, &e->inline_failed,
-				        false))
+				        false)
+	    || CALL_CANNOT_INLINE_P (e->call_stmt))
 	  {
 	    if (dump_file)
 	      {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]