From: Jan Hubicka Date: Mon, 20 Sep 2004 20:41:20 +0000 (+0000) Subject: cgraph.c (cgraph_unnest_node): New function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a94c545f042021777073269af02e9f9b4fec043;p=gcc.git cgraph.c (cgraph_unnest_node): New function. * cgraph.c (cgraph_unnest_node): New function. (c_finalize): Rename to .... (c_warn_unused_result_recursivly): ... this one; do only the warning (finish_function): Finalize the toplevel function; do not lower nested tree. * cgraph.h (cgraph_unnest_node): Declare. * cgraphunit.c (decide_is_function_needed): Do not use cgraph nestedness datastructure. * cse.c (cse_insn): Do not cprop nonlocal LABEL_REFs. * reload1.c (set_label_offsets): Fix call of set_label_offsets. * tree-nested.c (finlize_nesting_tree_1): Use un-nesting code. From-SVN: r87771 --- diff --git a/gcc/c-decl.c b/gcc/c-decl.c index e1e8d4d8f0d..76c1a08d3b4 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6128,30 +6128,21 @@ store_parm_decls (void) cfun->x_dont_save_pending_sizes_p = 1; } -/* Give FNDECL and all its nested functions to cgraph for compilation. */ +/* Handle attribute((warn_unused_result)) on FNDECL and all its nested + functions. */ static void -c_finalize (tree fndecl) +c_warn_unused_result_recursively (tree fndecl) { struct cgraph_node *cgn; /* Handle attribute((warn_unused_result)). Relies on gimple input. */ c_warn_unused_result (&DECL_SAVED_TREE (fndecl)); - /* ??? Objc emits functions after finalizing the compilation unit. - This should be cleaned up later and this conditional removed. */ - if (cgraph_global_info_ready) - { - c_expand_body (fndecl); - return; - } - /* Finalize all nested functions now. */ cgn = cgraph_node (fndecl); for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested) - c_finalize (cgn->decl); - - cgraph_finalize_function (fndecl, false); + c_warn_unused_result_recursively (cgn->decl); } /* Finish up a function declaration and compile that function @@ -6255,8 +6246,17 @@ finish_function (void) if (!decl_function_context (fndecl)) { c_genericize (fndecl); - lower_nested_functions (fndecl); - c_finalize (fndecl); + c_warn_unused_result_recursively (fndecl); + + /* ??? Objc emits functions after finalizing the compilation unit. + This should be cleaned up later and this conditional removed. */ + if (cgraph_global_info_ready) + { + c_expand_body (fndecl); + return; + } + + cgraph_finalize_function (fndecl, false); } else {