From 9f01464bdab3131189230d89d840dabe16fb3828 Mon Sep 17 00:00:00 2001
From: hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 2 Jan 2004 18:06:16 +0000
Subject: [PATCH] 	* cgraphunit.c (cgraph_optimize_function):  Call
 optimize_inline_calls 	when there is nothing to inline but warnings are
 requested. 	(cgraph_decide_inlining):  Fix memory leak.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75333 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog    |  6 ++++++
 gcc/cgraphunit.c | 22 +++++++++++-----------
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b2b7a14ab220..35dfeb86e231 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-01-02  Jan Hubicka  <jh@suse.cz>
+
+	* cgraphunit.c (cgraph_optimize_function):  Call optimize_inline_calls
+	when there is nothing to inline but warnings are requested.
+	(cgraph_decide_inlining):  Fix memory leak.
+
 2004-01-02  Jan Hubicka  <jh@suse.cz>
 
 	* expr.c (store_constructor):  Fix pasto in previous patch.
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index dfe4c7173dca..932c418a073c 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -476,7 +476,7 @@ cgraph_optimize_function (struct cgraph_node *node)
       struct cgraph_edge *e;
 
       for (e = node->callees; e; e = e->next_callee)
-	if (e->inline_call)
+	if (e->inline_call || warn_inline)
 	  break;
       if (e)
         optimize_inline_calls (decl);
@@ -1213,17 +1213,17 @@ cgraph_decide_inlining (void)
 		}
 	    }
 	}
-
-      if (cgraph_dump_file)
-	fprintf (cgraph_dump_file,
-		 "\nInlined %i calls, eliminated %i functions, "
-		 "%i insns turned to %i insns.\n\n",
-		 ncalls_inlined, nfunctions_inlined, initial_insns,
-		 overall_insns);
-      free (order);
-      free (inlined);
-      free (inlined_callees);
     }
+
+  if (cgraph_dump_file)
+    fprintf (cgraph_dump_file,
+	     "\nInlined %i calls, eliminated %i functions, "
+	     "%i insns turned to %i insns.\n\n",
+	     ncalls_inlined, nfunctions_inlined, initial_insns,
+	     overall_insns);
+  free (order);
+  free (inlined);
+  free (inlined_callees);
 }
 
 /* Decide on the inlining.  We do so in the topological order to avoid
-- 
GitLab