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]

Re: [PATCH][PING] Fix PR24310, ipa-inline dump corruption


> 
> Now that we opened again for bugfixes, may I have you re-consider
> 
> http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00220.html
> 
> that fixes the ipa-inline dump corruptions I'm seeing.  While not
> providing a correct fix (in the opinion of some of you, see the
> thread started by above message), it makes the situation incrementally
> better (and never worse) and is the most minimal fix I can think of
> for 4.1.
Actually I must agree with others that it is wrong to hold the memory.
This was just ommision I made while inserting the debugging code and is
rather easy to fix (even if bit ugly), so I am testing the attached
patch and will commit it if it suceeds.

2005-11-04  Jan Hubicka  <jh@suse.cz>
	* ipa-inline.c (cgraph_decide_inlining_of_small_function, 
	cgraph_decide_inlining, cgraph_decide_inlining_incrementally):
	Do not hold memory returned by cgraph_node_name across other call.
Index: ipa-inline.c
===================================================================
--- ipa-inline.c	(revision 106422)
+++ ipa-inline.c	(working copy)
@@ -722,11 +722,13 @@ cgraph_decide_inlining_of_small_function
       if (dump_file)
 	{
 	  fprintf (dump_file, 
-		   "\nConsidering %s with %i insns to be inlined into %s\n"
+		   "\nConsidering %s with %i insns\n",
+		   cgraph_node_name (edge->callee),
+		   edge->callee->global.insns);
+	  fprintf (dump_file, 
+		   " to be inlined into %s\n"
 		   " Estimated growth after inlined into all callees is %+i insns.\n"
 		   " Estimated badness is %i.\n",
-		   cgraph_node_name (edge->callee),
-		   edge->callee->global.insns,
 		   cgraph_node_name (edge->caller),
 		   cgraph_estimate_growth (edge->callee),
 		   cgraph_edge_badness (edge));
@@ -977,9 +979,10 @@ cgraph_decide_inlining (void)
 		{
 		  if (dump_file)
 		    fprintf (dump_file,
-			     "\nConsidering %s %i insns.\n"
+			     "\nConsidering %s %i insns.\n",
+			     cgraph_node_name (node), node->global.insns);
+		    fprintf (dump_file,
 			     " Called once from %s %i insns.\n",
-			     cgraph_node_name (node), node->global.insns,
 			     cgraph_node_name (node->callers->caller),
 			     node->callers->caller->global.insns);
 
@@ -1038,8 +1041,11 @@ cgraph_decide_inlining_incrementally (st
 	&& DECL_SAVED_TREE (e->callee->decl))
       {
         if (dump_file && early)
-          fprintf (dump_file, "  Early inlining %s into %s\n",
-		   cgraph_node_name (e->callee), cgraph_node_name (node));
+	  {
+	    fprintf (dump_file, "  Early inlining %s",
+		     cgraph_node_name (e->callee));
+	    fprintf (dump_file, " into %s\n", cgraph_node_name (node));
+	  }
 	cgraph_mark_inline (e);
 	inlined = true;
       }
@@ -1060,8 +1066,11 @@ cgraph_decide_inlining_incrementally (st
 	  if (cgraph_default_inline_p (e->callee, &failed_reason))
 	    {
 	      if (dump_file && early)
-                fprintf (dump_file, "  Early inlining %s into %s\n",
-			 cgraph_node_name (e->callee), cgraph_node_name (node));
+		{
+		  fprintf (dump_file, "  Early inlining %s",
+			   cgraph_node_name (e->callee));
+		  fprintf (dump_file, " into %s\n", cgraph_node_name (node));
+		}
 	      cgraph_mark_inline (e);
 	      inlined = true;
 	    }


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