summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-23 00:26:12 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-23 00:26:12 +0000
commitd3d410e15660be79881f484f5ccda6142cba0dca (patch)
treeea443ea7cda60dcc11a127388746050b3937dc2e /gcc
parentdff10ef03c055108997f01303702a8a002e4f6d8 (diff)
downloadgcc-d3d410e15660be79881f484f5ccda6142cba0dca.tar.gz
* cgraphunit.c (decide_is_function_needed): Also nested functions
and functions declared inline can be optimized out at -O0. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@114008 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/cgraphunit.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 27a17e5f3f7..988d4f9924e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 14e4dca4d47..8a4d0ec69eb 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -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;