]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cgraphunit.c (decide_is_function_needed): Also nested functions and functions declare...
authorJan Hubicka <jh@suse.cz>
Tue, 23 May 2006 00:26:12 +0000 (02:26 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 23 May 2006 00:26:12 +0000 (00:26 +0000)
* cgraphunit.c (decide_is_function_needed): Also nested functions
and functions declared inline can be optimized out at -O0.

From-SVN: r114008

gcc/ChangeLog
gcc/cgraphunit.c

index 27a17e5f3f7126c14bc765b1b47d516e80172c4c..988d4f9924ed00ba2ae9e0ab13510401d9602f28 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-23  Jan Hubicka  <jh@suse.cz>
+
+       * cgraphunit.c (decide_is_function_needed): Also nested functions
+       and functions declared inline can be optimized out at -O0.
+
 2006-05-22  Gerald Pfeifer  <gerald@pfeifer.com>
 
        * doc/install.texi (Configuration): Remove reference to CrossGCC
index 14e4dca4d47c3d3f0a947918a70e74600672d0e1..8a4d0ec69eb2658303d595d2661f4cd4d9b3506b 100644 (file)
@@ -219,10 +219,14 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
      COMDAT functions that must be output only when they are needed.
 
      When not optimizing, also output the static functions. (see
-     PR25962), but don't do so for always_inline functions.
-     */
+     PR25962), but don't do so for always_inline functions, functions
+     declared inline and nested functions.  These was optimized out
+     in the original implementation and it is unclear whether we want
+     to change the behaviour here.  */
   if (((TREE_PUBLIC (decl)
-       || (!optimize && !node->local.disregard_inline_limits))
+       || (!optimize && !node->local.disregard_inline_limits
+           && !DECL_DECLARED_INLINE_P (decl)
+           && !node->origin))
       && !flag_whole_program)
       && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
     return true;