diff options
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/gcc/function.c b/gcc/function.c index 1b41cf2..e673f21 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4400,25 +4400,14 @@ invoke_set_current_function_hook (tree fndecl) } targetm.set_current_function (fndecl); + this_fn_optabs = this_target_optabs; - if (opts == optimization_default_node) - this_fn_optabs = this_target_optabs; - else + if (opts != optimization_default_node) { - struct function *fn = DECL_STRUCT_FUNCTION (fndecl); - if (fn->optabs == NULL) - { - if (this_target_optabs == &default_target_optabs) - fn->optabs = TREE_OPTIMIZATION_OPTABS (opts); - else - { - fn->optabs = (unsigned char *) - ggc_alloc_atomic (sizeof (struct target_optabs)); - init_all_optabs ((struct target_optabs *) fn->optabs); - } - } - this_fn_optabs = fn->optabs ? (struct target_optabs *) fn->optabs - : this_target_optabs; + init_tree_optimization_optabs (opts); + if (TREE_OPTIMIZATION_OPTABS (opts)) + this_fn_optabs = (struct target_optabs *) + TREE_OPTIMIZATION_OPTABS (opts); } } } |