From: Paolo Bonzini Date: Tue, 15 Jun 2004 12:46:07 +0000 (+0000) Subject: function.h (struct function): Remove cannot_inline field. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=096f22f42494fad3990d6a2d74a9844dd6af977b;p=gcc.git function.h (struct function): Remove cannot_inline field. gcc/ChangeLog: 2004-06-15 Paolo Bonzini * function.h (struct function): Remove cannot_inline field. (current_function_cannot_inline): Remove. * passes.c (rest_of_compilation): Reset DECL_DEFER_OUTPUT. Simplify conditionals to ignore warn_return_type. * tree-optimize.c (tree_rest_of_compilation): Do not reset DECL_DEFER_OUTPUT. * objc/objc-act.c (build_module_descriptor, finish_method_def): Do not set current_function_cannot_inline. gcc/java/ChangeLog: 2004-06-15 Paolo Bonzini * class.c (emit_register_classes): Make the function uninlinable, do not set current_function_cannot_inline. * resource.c (write_resource_constructor): Do not reset flag_inline_functions around rest_of_compilation. gcc/cp/ChangeLog: 2004-06-15 Paolo Bonzini * cp-tree.h (struct language_function): Remove cannot_inline. * decl.c (save_function_data): cannot_inline is no more. (cxx_push_function_context): Likewise. * decl2.c (start_objects, start_static_storage_duration_function): Reset DECL_INLINE, set DECL_UNINLINABLE. From-SVN: r83181 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24b12e32ec4..e22b8002408 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2004-06-15 Paolo Bonzini + + * function.h (struct function): Remove cannot_inline field. + (current_function_cannot_inline): Remove. + * passes.c (rest_of_compilation): Reset DECL_DEFER_OUTPUT. + Simplify conditionals to ignore warn_return_type. + * tree-optimize.c (tree_rest_of_compilation): Do not reset + DECL_DEFER_OUTPUT. + * objc/objc-act.c (build_module_descriptor, finish_method_def): + Do not set current_function_cannot_inline. + 2004-06-15 J"orn Rennecke * cfglayout.c (fixup_reorder_chain): Handle case where the diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1fc8ec0fbab..518d73a17eb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2004-06-15 Paolo Bonzini + + * cp-tree.h (struct language_function): Remove cannot_inline. + * decl.c (save_function_data): cannot_inline is no more. + (cxx_push_function_context): Likewise. + * decl2.c (start_objects, start_static_storage_duration_function): + Reset DECL_INLINE, set DECL_UNINLINABLE. + 2004-06-14 Giovanni Bajo PR c++/15967 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 6f7baf3b677..db6b750ed8e 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -773,8 +773,6 @@ struct language_function GTY(()) struct named_label_list *x_named_labels; struct cp_binding_level *bindings; varray_type x_local_names; - - const char *cannot_inline; }; /* The current C++-specific per-function global variables. */ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 417171e760c..44a83d4345c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10491,15 +10491,6 @@ save_function_data (tree decl) f->x_named_label_uses = NULL; f->bindings = NULL; f->x_local_names = NULL; - - /* If we've already decided that we cannot inline this function, we - must remember that fact when we actually go to expand the - function. */ - if (current_function_cannot_inline) - { - f->cannot_inline = current_function_cannot_inline; - DECL_INLINE (decl) = 0; - } } /* Add a note to mark the beginning of the main body of the constructor. @@ -11156,11 +11147,6 @@ cxx_push_function_context (struct function * f) now, restore saved state. */ *cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn); - /* If we decided that we didn't want to inline this function, - make sure the back-end knows that. */ - if (!current_function_cannot_inline) - current_function_cannot_inline = cp_function_chain->cannot_inline; - /* We don't need the saved data anymore. Unless this is an inline function; we need the named return value info for cp_copy_res_decl_for_inlining. */ diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 038fea00879..57e3224e91f 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -1976,8 +1976,8 @@ start_objects (int method_type, int initp) have external linkage. And, there's no point in deferring compilation of thes functions; they're all going to have to be out anyhow. */ - current_function_cannot_inline - = "static constructors and destructors cannot be inlined"; + DECL_INLINE (current_function_decl) = 0; + DECL_UNINLINABLE (current_function_decl) = 1; return body; } @@ -2131,8 +2131,8 @@ start_static_storage_duration_function (unsigned count) /* This function must not be deferred because we are depending on its compilation to tell us what is TREE_SYMBOL_REFERENCED. */ - current_function_cannot_inline - = "static storage duration functions cannot be inlined"; + DECL_INLINE (ssdf_decl) = 0; + DECL_UNINLINABLE (ssdf_decl) = 1; return body; } diff --git a/gcc/function.h b/gcc/function.h index bd19e3d4450..19e3400eee9 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -232,10 +232,6 @@ struct function GTY(()) /* The arg pointer hard register, or the pseudo into which it was copied. */ rtx internal_arg_pointer; - /* Language-specific reason why the current function cannot be made - inline. */ - const char *cannot_inline; - /* Opaque pointer used by get_hard_reg_initial_val and has_hard_reg_initial_val (see integrate.[hc]). */ struct initial_value_struct *hard_reg_initial_vals; @@ -542,7 +538,6 @@ extern int trampolines_created; #define current_function_limit_stack (cfun->limit_stack) #define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table) #define current_function_uses_const_pool (cfun->uses_const_pool) -#define current_function_cannot_inline (cfun->cannot_inline) #define current_function_epilogue_delay_list (cfun->epilogue_delay_list) #define current_function_has_nonlocal_label (cfun->has_nonlocal_label) #define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 6c8af8a2895..b1427523068 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2004-06-15 Paolo Bonzini + + * class.c (emit_register_classes): Make the function uninlinable, + do not set current_function_cannot_inline. + * resource.c (write_resource_constructor): Do not reset + flag_inline_functions around rest_of_compilation. + 2004-06-08 Andrew Pinski PR java/15769 diff --git a/gcc/java/class.c b/gcc/java/class.c index 137b647d191..57107dd4577 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -2293,6 +2293,8 @@ emit_register_classes (void) DECL_SOURCE_LINE (init_decl) = 0; TREE_STATIC (init_decl) = 1; current_function_decl = init_decl; + DECL_INLINE (init_decl) = 0; + DECL_UNINLINABLE (init_decl) = 1; DECL_RESULT (init_decl) = build_decl (RESULT_DECL, NULL_TREE, void_type_node); @@ -2308,10 +2310,6 @@ emit_register_classes (void) init_function_start (init_decl); expand_function_start (init_decl, 0); - /* Do not allow the function to be deferred. */ - current_function_cannot_inline - = "static constructors and destructors cannot be inlined"; - for ( t = registered_class; t; t = TREE_CHAIN (t)) emit_library_call (registerClass_libfunc, 0, VOIDmode, 1, XEXP (DECL_RTL (t), 0), Pmode); diff --git a/gcc/java/resource.c b/gcc/java/resource.c index dc42a6f6e7e..5ebbf5e100a 100644 --- a/gcc/java/resource.c +++ b/gcc/java/resource.c @@ -151,14 +151,10 @@ write_resource_constructor (void) input_location = DECL_SOURCE_LOCATION (init_decl); expand_function_end (); poplevel (1, 0, 1); - { - /* Force generation, even with -O3 or deeper. Gross hack. - FIXME. */ - int saved_flag = flag_inline_functions; - flag_inline_functions = 0; - rest_of_compilation (init_decl); - flag_inline_functions = saved_flag; - } + + /* rest_of_compilation forces generation even if -finline-functions. */ + rest_of_compilation (init_decl); + current_function_decl = NULL_TREE; if (targetm.have_ctors_dtors) targetm.asm_out.constructor (XEXP (DECL_RTL (init_decl), 0), diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 96e29b181ba..97a36a02b4e 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -1910,8 +1910,6 @@ build_module_descriptor (void) /* Don't let this one be deferred. */ DECL_INLINE (init_function_decl) = 0; DECL_UNINLINABLE (init_function_decl) = 1; - current_function_cannot_inline - = "static constructors and destructors cannot be inlined"; parms = build_tree_list (NULL_TREE, @@ -7981,7 +7979,6 @@ finish_method_def (void) dispatched, so suppress all thoughts of doing so. */ DECL_INLINE (current_function_decl) = 0; DECL_UNINLINABLE (current_function_decl) = 1; - current_function_cannot_inline = "methods cannot be inlined"; finish_function (); lang_expand_function_end = NULL; diff --git a/gcc/passes.c b/gcc/passes.c index d3114de937e..fb976a8015a 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1359,6 +1359,10 @@ rest_of_compilation (tree decl) timevar_push (TV_REST_OF_COMPILATION); + /* There's no need to defer outputting this function any more; we + know we want to output it. */ + DECL_DEFER_OUTPUT (current_function_decl) = 0; + /* Register rtl specific functions for cfg. */ rtl_register_cfg_hooks (); @@ -1425,8 +1429,7 @@ rest_of_compilation (tree decl) /* Initialize some variables used by the optimizers. */ init_function_for_compilation (); - if (! DECL_DEFER_OUTPUT (decl)) - TREE_ASM_WRITTEN (decl) = 1; + TREE_ASM_WRITTEN (decl) = 1; /* Now that integrate will no longer see our rtl, we need not distinguish between the return value of this function and the @@ -1438,10 +1441,8 @@ rest_of_compilation (tree decl) purge_hard_subreg_sets (get_insns ()); /* Early return if there were errors. We can run afoul of our - consistency checks, and there's not really much point in fixing them. - Don't return yet if -Wreturn-type; we need to do cleanup_cfg. */ - if (((rtl_dump_and_exit || flag_syntax_only) && !warn_return_type) - || errorcount || sorrycount) + consistency checks, and there's not really much point in fixing them. */ + if (rtl_dump_and_exit || flag_syntax_only || errorcount || sorrycount) goto exit_rest_of_compilation; timevar_push (TV_JUMP); @@ -1534,15 +1535,8 @@ rest_of_compilation (tree decl) purge_line_number_notes (insns); - timevar_pop (TV_JUMP); close_dump_file (DFI_jump, print_rtl, insns); - /* Now is when we stop if -fsyntax-only and -Wreturn-type. */ - if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl)) - goto exit_rest_of_compilation; - - timevar_push (TV_JUMP); - if (optimize) cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP); diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index ee03a98f1d6..00618474f6b 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -582,10 +582,6 @@ tree_rest_of_compilation (tree fndecl, bool nested_p) if (nested_p) ggc_push_context (); - /* There's no need to defer outputting this function any more; we - know we want to output it. */ - DECL_DEFER_OUTPUT (fndecl) = 0; - /* Run the optimizers and output the assembler code for this function. */ rest_of_compilation (fndecl);