From b633db7b859751e579a2f0d44c6869c2f505beb8 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 23 May 2006 02:26:12 +0200 Subject: cgraphunit.c (decide_is_function_needed): Also nested functions and functions declared inline can be optimized out at -O0. * cgraphunit.c (decide_is_function_needed): Also nested functions and functions declared inline can be optimized out at -O0. From-SVN: r114008 --- gcc/cgraphunit.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 14e4dca..8a4d0ec 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; -- cgit v1.1