diff options
author | Jan Hubicka <jh@suse.cz> | 2007-09-11 12:39:53 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2007-09-11 10:39:53 +0000 |
commit | e89d6010089634063adfeeec679ac7fbf6afa4e6 (patch) | |
tree | a9c246259502c55141f2c727f2747541fd04e58b /gcc | |
parent | 8ce4afa36d051920c2a67e54340e2a72fa33cbdd (diff) | |
download | gcc-e89d6010089634063adfeeec679ac7fbf6afa4e6.zip gcc-e89d6010089634063adfeeec679ac7fbf6afa4e6.tar.gz gcc-e89d6010089634063adfeeec679ac7fbf6afa4e6.tar.bz2 |
decl.c (java_expand_body): Kill.
* decl.c (java_expand_body): Kill.
(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
* toplev.c (process_options): all frontends now do unit-at-a-time.
* cgraphunit.c: update comments.
(cgraph_expand_function): call passmanager dirrectly; emit thunks.
* c-decl.c (finish_function): use cgraph_add_new_function.
* method.c (use_thunk): Use tree_rest_of_compilation
* cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
(LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define.
* cp-tree.h (expand_body): Kill.
(emit_associated_thunks): Declare.
* semantics.c (emit_associated_thunks): Export.
(expand_body): Kill.
* misc.c (gnat_expand_body): Kill.
(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
* f95-lang.c (gfc_expand_function): Kill.
(LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.
* function.c (expand_function_end): We are always unit-at-a-time.
From-SVN: r128367
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/misc.c | 11 | ||||
-rw-r--r-- | gcc/c-common.c | 9 | ||||
-rw-r--r-- | gcc/c-decl.c | 2 | ||||
-rw-r--r-- | gcc/cgraphunit.c | 13 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/cp-objcp-common.h | 4 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/method.c | 2 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 19 | ||||
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/f95-lang.c | 41 | ||||
-rw-r--r-- | gcc/function.c | 7 | ||||
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/decl.c | 8 | ||||
-rw-r--r-- | gcc/java/lang.c | 3 | ||||
-rw-r--r-- | gcc/langhooks-def.h | 4 | ||||
-rw-r--r-- | gcc/langhooks.h | 4 | ||||
-rw-r--r-- | gcc/passes.c | 3 | ||||
-rw-r--r-- | gcc/toplev.c | 5 |
21 files changed, 47 insertions, 123 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1c9a5d0..1706076 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2007-09-11 Jan Hubicka <jh@suse.cz> + + * toplev.c (process_options): all frontends now do unit-at-a-time. + * cgraphunit.c: update comments. + (cgraph_expand_function): call passmanager dirrectly; emit thunks. + * c-decl.c (finish_function): use cgraph_add_new_function. + * function.c (expand_function_end): We are always unit-at-a-time. + 2007-09-11 Richard Sandiford <richard@codesourcery.com> * config/mips/mips.c (mips_set_mips16_mode): Use separate anchor diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f1c654f..05182f8 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2007-09-11 Jan Hubicka <jh@suse.cz> + + * misc.c (gnat_expand_body): Kill. + (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill. + 2007-09-10 Robert Dewar <dewar@adacore.com> * exp_atag.ads, exp_atag.adb, mlib-tgt-tru64.adb, mlib-tgt-aix.adb, diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c index cad474d..473beb0 100644 --- a/gcc/ada/misc.c +++ b/gcc/ada/misc.c @@ -100,7 +100,6 @@ static int gnat_eh_type_covers (tree, tree); static void gnat_parse_file (int); static rtx gnat_expand_expr (tree, rtx, enum machine_mode, int, rtx *); -static void gnat_expand_body (tree); static void internal_error_function (const char *, va_list *); static void gnat_adjust_rli (record_layout_info); static tree gnat_type_max_size (const_tree); @@ -149,8 +148,6 @@ static tree gnat_type_max_size (const_tree); #define LANG_HOOKS_DECL_PRINTABLE_NAME gnat_printable_name #undef LANG_HOOKS_DWARF_NAME #define LANG_HOOKS_DWARF_NAME gnat_dwarf_name -#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION -#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION gnat_expand_body #undef LANG_HOOKS_GIMPLIFY_EXPR #define LANG_HOOKS_GIMPLIFY_EXPR gnat_gimplify_expr #undef LANG_HOOKS_TYPE_FOR_MODE @@ -678,14 +675,6 @@ gnat_expand_expr (tree exp, rtx target, enum machine_mode tmode, return expand_expr_real (new, target, tmode, modifier, alt_rtl); } -/* Generate the RTL for the body of GNU_DECL. */ - -static void -gnat_expand_body (tree gnu_decl) -{ - tree_rest_of_compilation (gnu_decl); -} - /* Adjusts the RLI used to layout a record after all the fields have been added. We only handle the packed case and cause it to use the alignment that will pad the record at the end. */ diff --git a/gcc/c-common.c b/gcc/c-common.c index 147f5c1..f6af052 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -4577,15 +4577,6 @@ c_expand_expr (tree exp, rtx target, enum machine_mode tmode, } } - -/* Generate the RTL for the body of FNDECL. */ - -void -c_expand_body (tree fndecl) -{ - tree_rest_of_compilation (fndecl); -} - /* Hook used by staticp to handle language-specific tree codes. */ tree diff --git a/gcc/c-decl.c b/gcc/c-decl.c index bb790a2..83fc7b9 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6799,7 +6799,7 @@ finish_function (void) This should be cleaned up later and this conditional removed. */ if (cgraph_global_info_ready) { - c_expand_body (fndecl); + cgraph_add_new_function (fndecl, false); return; } diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 61d834d..0218d26 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -76,15 +76,6 @@ along with GCC; see the file COPYING3. If not see ??? On the tree-ssa genericizing should take place here and we will avoid need for these hooks (replacing them by genericizing hook) - - expand_function callback - - This function is used to expand function and pass it into RTL back-end. - Front-end should not make any assumptions about when this function can be - called. In particular cgraph_assemble_pending_functions, - varpool_assemble_pending_variables, cgraph_finalize_function, - varpool_finalize_function, cgraph_optimize can cause arbitrarily - previously finalized functions to be expanded. - We implement two compilation modes. - unit-at-a-time: In this mode analyzing of all functions is deferred @@ -1074,7 +1065,9 @@ cgraph_expand_function (struct cgraph_node *node) } /* Generate RTL for the body of DECL. */ - lang_hooks.callgraph.expand_function (decl); + if (lang_hooks.callgraph.emit_associated_thunks) + lang_hooks.callgraph.emit_associated_thunks (decl); + tree_rest_of_compilation (decl); /* Make sure that BE didn't give up on compiling. */ /* ??? Can happen with nested function of extern inline. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cdbffb1..a73da49 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2007-09-11 Jan Hubicka <jh@suse.cz> + + * method.c (use_thunk): Use tree_rest_of_compilation + * cp-objecp-common.h (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill. + (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Define. + * cp-tree.h (expand_body): Kill. + (emit_associated_thunks): Declare. + * semantics.c (emit_associated_thunks): Export. + (expand_body): Kill. + 2007-09-09 David Daney <ddaney@avtrex.com> PR c++/33324 diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h index 8c8f933..dd23613 100644 --- a/gcc/cp/cp-objcp-common.h +++ b/gcc/cp/cp-objcp-common.h @@ -115,8 +115,8 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t, #undef LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR #define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR cxx_callgraph_analyze_expr -#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION -#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION expand_body +#undef LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS +#define LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS emit_associated_thunks #undef LANG_HOOKS_MAKE_TYPE #define LANG_HOOKS_MAKE_TYPE cxx_make_type diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 9bd8ed2..5efbdb7 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4639,7 +4639,7 @@ extern tree finish_typeof (tree); extern tree finish_offsetof (tree); extern void finish_decl_cleanup (tree, tree); extern void finish_eh_cleanup (tree); -extern void expand_body (tree); +extern void emit_associated_thunks (tree); extern void finish_mem_initializers (tree); extern tree check_template_template_default_arg (tree); extern void expand_or_defer_fn (tree); diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 2130454..05e21ba 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -523,7 +523,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) thunk_fndecl = finish_function (0); tree_lowering_passes (thunk_fndecl); - expand_body (thunk_fndecl); + tree_rest_of_compilation (thunk_fndecl); } pop_from_top_level (); diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 28fe481..b164102 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -54,7 +54,6 @@ along with GCC; see the file COPYING3. If not see static tree maybe_convert_cond (tree); static tree simplify_aggr_init_exprs_r (tree *, int *, void *); -static void emit_associated_thunks (tree); static tree finalize_nrv_r (tree *, int *, void *); @@ -3094,7 +3093,7 @@ simplify_aggr_init_expr (tree *tp) /* Emit all thunks to FN that should be emitted when FN is emitted. */ -static void +void emit_associated_thunks (tree fn) { /* When we use vcall offsets, we emit thunks with the virtual @@ -3129,22 +3128,6 @@ emit_associated_thunks (tree fn) /* Generate RTL for FN. */ void -expand_body (tree fn) -{ - /* Emit any thunks that should be emitted at the same time as FN. */ - emit_associated_thunks (fn); - - /* This function is only called from cgraph, or recursively from - emit_associated_thunks. In neither case should we be currently - generating trees for a function. */ - gcc_assert (function_depth == 0); - - c_expand_body (fn); -} - -/* Generate RTL for FN. */ - -void expand_or_defer_fn (tree fn) { /* When the parser calls us after finishing the body of a template diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a3a1263..348d2b0 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2007-09-11 Jan Hubicka <jh@suse.cz> + + * f95-lang.c (gfc_expand_function): Kill. + (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill. + 2007-09-08 Tobias Burnus <burnus@net-b.de> PR fortran/31547 diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c index b9eb1f8..c5c602b 100644 --- a/gcc/fortran/f95-lang.c +++ b/gcc/fortran/f95-lang.c @@ -98,7 +98,6 @@ int global_bindings_p (void); void insert_block (tree); static void gfc_clear_binding_stack (void); static void gfc_be_parse_file (int); -static void gfc_expand_function (tree); static alias_set_type gfc_get_alias_set (tree); #undef LANG_HOOKS_NAME @@ -135,7 +134,6 @@ static alias_set_type gfc_get_alias_set (tree); #define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable #define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode #define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size -#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION gfc_expand_function #define LANG_HOOKS_CLEAR_BINDING_STACK gfc_clear_binding_stack #define LANG_HOOKS_GET_ALIAS_SET gfc_get_alias_set #define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE gfc_omp_privatize_by_reference @@ -194,45 +192,6 @@ static GTY(()) struct binding_level *free_binding_level; It is indexed by a RID_... value. */ tree *ridpointers = NULL; -/* language-specific flags. */ - -static void -gfc_expand_function (tree fndecl) -{ - tree t; - - if (DECL_INITIAL (fndecl) - && BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl))) - { - /* Local static equivalenced variables are never seen by - check_global_declarations, so we need to output debug - info by hand. */ - - t = BLOCK_SUBBLOCKS (DECL_INITIAL (fndecl)); - for (t = BLOCK_VARS (t); t; t = TREE_CHAIN (t)) - if (TREE_CODE (t) == VAR_DECL && DECL_HAS_VALUE_EXPR_P (t) - && TREE_STATIC (t)) - { - tree expr = DECL_VALUE_EXPR (t); - - if (TREE_CODE (expr) == COMPONENT_REF - && TREE_CODE (TREE_OPERAND (expr, 0)) == VAR_DECL - && TREE_CODE (TREE_TYPE (TREE_OPERAND (expr, 0))) - == UNION_TYPE - && varpool_node (TREE_OPERAND (expr, 0))->needed - && errorcount == 0 && sorrycount == 0) - { - timevar_push (TV_SYMOUT); - (*debug_hooks->global_decl) (t); - timevar_pop (TV_SYMOUT); - } - } - } - - tree_rest_of_compilation (fndecl); -} - - /* Prepare expr to be an argument of a TRUTH_NOT_EXPR, or validate its data type for an `if' or `while' statement or ?..: exp. diff --git a/gcc/function.c b/gcc/function.c index a2956b3..ffee598 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4404,13 +4404,6 @@ expand_function_end (void) } } - /* Possibly warn about unused parameters. - When frontend does unit-at-a-time, the warning is already - issued at finalization time. */ - if (warn_unused_parameter - && !lang_hooks.callgraph.expand_function) - do_warn_unused_parameter (current_function_decl); - /* End any sequences that failed to be closed due to syntax errors. */ while (in_sequence_p ()) end_sequence (); diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index f8f5c35..6cc295f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2007-09-11 Jan Hubicka <jh@suse.cz> + + * decl.c (java_expand_body): Kill. + (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill. + 2007-09-06 Tom Tromey <tromey@redhat.com> * jcf-parse.c (parse_class_file): Re-enter the current file. diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 594ccf1..2cf87c2 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -1862,14 +1862,6 @@ finish_method (tree fndecl) cgraph_finalize_function (fndecl, false); } -/* Optimize and expand a function's entire body. */ - -void -java_expand_body (tree fndecl) -{ - tree_rest_of_compilation (fndecl); -} - /* We pessimistically marked all methods and fields external until we knew what set of classes we were planning to compile. Now mark those associated with CLASS to be generated locally as not external. */ diff --git a/gcc/java/lang.c b/gcc/java/lang.c index 6a453fc..64b168c 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -192,9 +192,6 @@ struct language_function GTY(()) #undef LANG_HOOKS_GET_CALLEE_FNDECL #define LANG_HOOKS_GET_CALLEE_FNDECL java_get_callee_fndecl -#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION -#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION java_expand_body - #undef LANG_HOOKS_CLEAR_BINDING_STACK #define LANG_HOOKS_CLEAR_BINDING_STACK java_clear_binding_stack diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h index 4c4be49..523fc0b 100644 --- a/gcc/langhooks-def.h +++ b/gcc/langhooks-def.h @@ -138,11 +138,11 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *, } #define LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR lhd_callgraph_analyze_expr -#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION NULL +#define LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS NULL #define LANG_HOOKS_CALLGRAPH_INITIALIZER { \ LANG_HOOKS_CALLGRAPH_ANALYZE_EXPR, \ - LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION, \ + LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS, \ } #define LANG_HOOKS_FUNCTION_INITIALIZER { \ diff --git a/gcc/langhooks.h b/gcc/langhooks.h index 2b3517e..ad925a8 100644 --- a/gcc/langhooks.h +++ b/gcc/langhooks.h @@ -44,8 +44,8 @@ struct lang_hooks_for_callgraph are relevant to use of other declarations, mark them. */ tree (*analyze_expr) (tree *, int *, tree); - /* Produce RTL for function passed as argument. */ - void (*expand_function) (tree); + /* Emmit thunks associated to function. */ + void (*emit_associated_thunks) (tree); }; /* Lang hooks for management of language-specific data or status diff --git a/gcc/passes.c b/gcc/passes.c index 48f4af0..0bcb7c7 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -461,8 +461,7 @@ next_pass_1 (struct tree_opt_pass **list, struct tree_opt_pass *pass) cgraph_expand_all_functions () for each node N in the cgraph cgraph_expand_function (N) - lang_hooks.callgraph.expand_function (DECL (N)) - tree_rest_of_compilation (DECL (N)) -> all_passes + tree_rest_of_compilation (DECL (N)) -> all_passes */ void diff --git a/gcc/toplev.c b/gcc/toplev.c index 76887bc..0c4b638 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1785,11 +1785,6 @@ process_options (void) if (flag_asynchronous_unwind_tables) flag_unwind_tables = 1; - /* Disable unit-at-a-time mode for frontends not supporting callgraph - interface. */ - if (flag_unit_at_a_time && ! lang_hooks.callgraph.expand_function) - flag_unit_at_a_time = 0; - if (!flag_unit_at_a_time) flag_section_anchors = 0; |