diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-07 09:01:16 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-10-07 09:01:16 +0000 |
commit | 59dd48301d310463d3fffaf4c68d8df57fa20073 (patch) | |
tree | 6ff88658df2366f15ab2403c0f6349c01d7b3ee5 /gcc/passes.c | |
parent | 56ca37b0c20769386b4481c6911873c65d09e27d (diff) | |
download | gcc-59dd48301d310463d3fffaf4c68d8df57fa20073.tar.gz |
* lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has
no address taken.
* cgraph.c (cgraph_mark_needed_node): Assert that inline clones are
never needed.
(cgraph_clone_node): Clear externally_visible flag for clones.
* cgraph.h (cgraph_only_called_directly_p,
cgraph_can_remove_if_no_direct_calls_p): New predicates.
* tree-pass.h (pass_ipa_whole_program_visibility): Declare.
* ipa-cp.c (ipcp_cloning_candidate_p): Use new predicate.
(ipcp_initialize_node_lattices, ipcp_estimate_growth,
ipcp_insert_stage): Likwise.
* cgraphunit.c (cgraph_decide_is_function_needed): Do not compute
externally_visible flag.
(verify_cgraph_node): Verify that inline clones look right.
(process_function_and_variable_attributes): Do not set
externally_visible flags.
(ipa_passes): Avoid executing small_ipa_passes at LTO stage; they've
been already run.
* lto-cgraph.c (lto_output_node): Assert that inline clones are not
boundaries.
* ipa-inline.c (cgraph_clone_inlined_nodes): Use new predicates;
clear externally_visible when turning into inline clones
(cgraph_mark_inline_edge): Use new predicates.
(cgraph_estimate_growth): Likewise.
(cgraph_decide_inlining): Likewise.
* ipa.c (cgraph_postorder): Likewise.
(cgraph_remove_unreachable_nodes): Likewise; sanity check
that inline clones are not needed.
(cgraph_externally_visible_p): New predicate.
(function_and_variable_visibility): Add whole_program parameter;
always set externally_visible flag; handle COMDAT function
privatization.
(local_function_and_variable_visibility): New function.
(gate_whole_program_function_and_variable_visibility): New function.
(whole_program_function_and_variable_visibility): New function.
(pass_ipa_whole_program_visibility): New function.
* passes.c (init_optimization_passes): Add whole program visibility
pass.
(do_per_function_toporder, function_called_by_processed_nodes_p): Do
not care about needed/reachable flags.
* varpool.c: Include flags.h
(decide_is_variable_needed): When doing LTO assume whole-program mode.
(varpool_finalize_decl): When we are in LTO read-back, all variables
are analyzed.
(varpool_analyze_pending_decls): Skip analyzis of analyzed vars.
* lto/lto.c (read_cgraph_and_symbols): Mark functions neccesary only at
ltrans stage; explain why this is needed and should not.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152520 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/passes.c')
-rw-r--r-- | gcc/passes.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/passes.c b/gcc/passes.c index e3fd7a8454d..60a850969c2 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -759,6 +759,7 @@ init_optimization_passes (void) *p = NULL; p = &all_regular_ipa_passes; + NEXT_PASS (pass_ipa_whole_program_visibility); NEXT_PASS (pass_ipa_cp); NEXT_PASS (pass_ipa_inline); NEXT_PASS (pass_ipa_reference); @@ -1099,7 +1100,7 @@ do_per_function_toporder (void (*callback) (void *data), void *data) /* Allow possibly removed nodes to be garbage collected. */ order[i] = NULL; node->process = 0; - if (node->analyzed && (node->needed || node->reachable)) + if (node->analyzed) { push_cfun (DECL_STRUCT_FUNCTION (node->decl)); current_function_decl = node->decl; @@ -1783,7 +1784,7 @@ function_called_by_processed_nodes_p (void) { if (e->caller->decl == current_function_decl) continue; - if (!e->caller->analyzed || (!e->caller->needed && !e->caller->reachable)) + if (!e->caller->analyzed) continue; if (TREE_ASM_WRITTEN (e->caller->decl)) continue; |