From 58b123de45702b087d8db1c15e709cb004c404d6 Mon Sep 17 00:00:00 2001 From: amylaar Date: Fri, 20 Nov 2009 23:17:21 +0000 Subject: [PATCH] * opts.c (decode_options): Properly move optimization_default_node initialization from here ... * toplev.c (process_options) ... to here. * toplev.c (backend_init_target): Remove change from GSOC - purpose is unknown, hence might be be assumed an artistic expression. * cgraphunit.c (ipa_passes): Rename local variable. * ipa-inline.c (analyze_function): Remove GSOC patch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ici-20091108-branch@154383 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cgraphunit.c | 6 +++--- gcc/ipa-inline.c | 11 +---------- gcc/opts.c | 8 +------- gcc/toplev.c | 18 ++++-------------- 4 files changed, 9 insertions(+), 34 deletions(-) diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 493ceb7e626..07d82f8800f 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1354,7 +1354,7 @@ cgraph_preserve_function_body_p (tree decl) static void ipa_passes (void) { - int substitute_status = 0; + int executed_p = 0; set_cfun (NULL); current_function_decl = NULL; @@ -1363,8 +1363,8 @@ ipa_passes (void) invoke_plugin_callbacks (PLUGIN_ALL_IPA_PASSES_START, NULL); - invoke_plugin_callbacks (PLUGIN_ALL_IPA_PASSES_EXECUTION, &substitute_status); - if (substitute_status == 0) + invoke_plugin_callbacks (PLUGIN_ALL_IPA_PASSES_EXECUTION, &executed_p); + if (!executed_p) { if (!in_lto_p) execute_ipa_pass_list (all_small_ipa_passes); diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index c2b71e0e0a3..bc7048f51c6 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1906,16 +1906,7 @@ analyze_function (struct cgraph_node *node) current_function_decl = node->decl; compute_inline_parameters (node); - /* We should not execute inline_indirect_intraprocedural_analysis() - if NODE->decl has function_specific_optimization, and - optimize is 0 or 1. Right? */ - if (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node->decl) != NULL_TREE) - { - if (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node->decl) - ->optimization.opts.optimize > 1) - inline_indirect_intraprocedural_analysis (node); - } - else if (flag_indirect_inlining) + if (flag_indirect_inlining) inline_indirect_intraprocedural_analysis (node); current_function_decl = NULL; diff --git a/gcc/opts.c b/gcc/opts.c index b2b6c4454ee..680add4832e 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1102,13 +1102,6 @@ decode_options (unsigned int argc, const char **argv) flag_ira_algorithm = IRA_ALGORITHM_PRIORITY; } - /* Save the current optimization options if this is the first call. */ - if (first_time_p) - { - optimization_default_node = build_optimization_node (); - optimization_current_node = optimization_default_node; - first_time_p = false; - } if (flag_conserve_stack) { if (!PARAM_SET_P (PARAM_LARGE_STACK_FRAME)) @@ -1139,6 +1132,7 @@ decode_options (unsigned int argc, const char **argv) check option consistency. */ if (flag_lto && flag_whopr) error ("-flto and -fwhopr are mutually exclusive"); + first_time_p = false; } #define LEFT_COLUMN 27 diff --git a/gcc/toplev.c b/gcc/toplev.c index 6d07f034704..a93b4fc729b 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1771,8 +1771,6 @@ init_alignments (void) static void process_options (void) { - /* ??? will this function be called more than once */ - static bool first_time_p = true; /* Just in case lang_hooks.post_options ends up calling a debug_hook. This can happen with incorrect pre-processed input. */ debug_hooks = &do_nothing_debug_hooks; @@ -2140,17 +2138,9 @@ process_options (void) flag_omit_frame_pointer = 0; } - /* ??? some flags may have changed, so save the optimization_default_node again. - We may need to remove the corresponding code in decode_options() */ - if (first_time_p) - { - - optimization_default_node = build_optimization_node (); - optimization_current_node = optimization_default_node; - - first_time_p = false; - } - + /* Save the current optimization options. */ + optimization_default_node = build_optimization_node (); + optimization_current_node = optimization_default_node; } /* This function can be called multiple times to reinitialize the compiler @@ -2190,7 +2180,7 @@ backend_init_target (void) /* We may need to recompute regno_save_code[] and regno_restore_code[] after a mode change as well. */ - /*if (flag_caller_saves)*/ + if (flag_caller_saves) init_caller_save (); expand_dummy_function_end (); } -- 2.11.4.GIT