gcc/gcc/cgraphunit.c

2475 lines
72 KiB
C
Raw Normal View History

/* Callgraph based interprocedural optimizations.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Jan Hubicka
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
/* This module implements main driver of compilation process as well as
few basic interprocedural optimizers.
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
The main scope of this file is to act as an interface in between
tree based frontends and the backend (and middle end)
The front-end is supposed to use following functionality:
- cgraph_finalize_function
This function is called once front-end has parsed whole body of function
and it is certain that the function body nor the declaration will change.
(There is one exception needed for implementing GCC extern inline
function.)
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
- varpool_finalize_variable
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
This function has same behavior as the above but is used for static
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
variables.
- cgraph_finalize_compilation_unit
This function is called once (source level) compilation unit is finalized
and it will no longer change.
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. (build_cgraph_edges): Likewise. * cgraph.c (cgraph_node): Do not update assembler hash. (cgraph_remove_node): Drop non-unit-at-a-time code. * tree-pass.h (pass_O0_always_inline): Remove. * ipa-reference.c (gate_reference): Remove unit-at-a-time check. * toplev.c (process_options): Flag unit-at-a-time does not imply no section anchors. * cgraphunit.c: Update comments. (decide_is_function_needed): Drop non-unit-at-a-time mode. (cgraph_assemble_pending_functions): Remove. (cgraph_reset_node): Drop non-unit-at-a-time code. (cgraph_finalize_function): Likewise. (cgraph_analyze_function): Likewise. (cgraph_finalize_compilation_unit): Likewise. (cgraph_expand_function): Likewise. (cgraph_optimize): Likesise. (save_inline_function_body): Likewise. * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check. * tree-ssa-alias.c (maybe_be_aliased): Likewise. * ipa-inline.c: Update comments. (enum inlining_mode): remove INLINE_SPEED. (cgraph_clone_inlined_nodes): Drop unit-at-a-time check. (cgraph_mark_inline_edge): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. (cgraph_gate_inlining): Remove. (cgraph_early_inlining): Remove flag_unit_at_a_time checks. (cgraph_gate_early_inlining): Likewise. (gate_inline_passes): Remove. (pass_inline_parameters, pass_ipa_inline): Remove gates. (cgraph_gate_O0_always_inline, cgraph_O0_always_inline, pass_O0_always_inline): Remove. * c-pch.c (c_pch_matching): Remove -funit-at-a-time. * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check. * opts.c (no_unit_at_a_time_default): Remove. (decode_options): Remove flag_unit_at_a_time reset and warning. * opts.h (no_unit_at_a_time_default): Remove. * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword early in GNU dialect. (merge_decls): Update comment; drop unit-at-a-time check. (finish_decl): Likewise. (grok_declaration): Remove flag_inline_trees code. (finish_functions): Return on function returning non-void on all statics. * ipa-tye-escape.c (gate_type_escape_vars): Remove. * cfgexpand.c (expand_one_static_var): Remove. (expand_one_var): Remove expand_one_static_var call. (expand_used_vars_for_block): Remove flag_unit_a_time check. * c-opts.c (c_common_post_options): Remove flag_inline_trees code and flag_unit_at_a-time compatibility checks. * varasm.c (assemble_alias): Remove flag_unit_at_a_time check. * tree-inline.c (flag_inline_trees): Remove. (inlinable_function_p): Don't check it. (expand_call_inline): Remove non-unit-at-a-time code. * tree-inline.h (flag_inline_trees): Remove. * tree-optimize.c (execute_early_local_optimizations): Remove unit-at-a-time checks. (tree_rest_of_compilation): Likewise. * combine.c (setup_incoming_promotions): Likewise. * tree-profile.c (tree_gen_ic_func_profiler): Likewise. * tree-ssa-structalias.c (delete_points_to_sets): Likewise. * passes.c (pass_inline_parameters): Update comments; remove O0_alwaysinline pass. (execute_one_ipa_transform_pass): Do not reset in_gimple_form. (execute_one_pass): Likewise. * i386.c (ix86_function_regparm): Remove unit-at-a-time check. (ix86_function_sseregparm): Likewise. * arm.c (arm_function_in_section_p): Likewise. * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise. * varpool.c: Update comments. (decide_is_variable_needed): Remove unit-at-a-time checks. (varpool_finalize_decl): Likewise. * ada/utils.c (end_subprog_body): Remove inline trees check. * ada/misc.c (gnat_post_options): Do not set flag_inline_trees. * fortran/options.c (gfc_post_options): Remove flag_unline_trees code. * gcc.dg/winline-4.c: Remove. * gcc.dg/pch/valid-3.hs: Remove. * gcc.dg/pch/valid-3.c: Remove. * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning * g++.old-deja/g++.jason/report.C: Likewise. * testsuite/g++.dg/warn/pr23075.C: We get returning void warning instead of control flow warning. * cp/decl.c (duplicate_decls): Update comment and unit-at-a-time. (grogfndecl): Drop flag_inline_trees code. * cp/pt.c (instantiate_decl): Drop flag_iline_trees code. * cp/lex.c (cxx_init): Do not set unit-at-a-time. * java/decl.c: Include cgraph.h (end_java_method): Remove non-unit-at-a-time code. (java_mark_decl_local): Likewise; sanity check that we don't touch finalized nodes. From-SVN: r138140
2008-07-25 15:11:32 +02:00
In the the call-graph construction and local function
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
analysis takes place here. Bodies of unreachable functions are released
to conserve memory usage.
The function can be called multiple times when multiple source level
compilation units are combined (such as in C frontend)
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
- cgraph_optimize
In this unit-at-a-time compilation the intra procedural analysis takes
place here. In particular the static functions whose address is never
taken are marked as local. Backend can then use this information to
modify calling conventions, do better inlining or similar optimizations.
- cgraph_mark_needed_node
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
- varpool_mark_needed_node
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
When function or variable is referenced by some hidden way the call-graph
data structure must be updated accordingly by this function.
There should be little need to call this function and all the references
should be made explicit to cgraph code. At present these functions are
used by C++ frontend to explicitly mark the keyed methods.
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
- analyze_expr callback
This function is responsible for lowering tree nodes not understood by
generic code into understandable ones or alternatively marking
callgraph and varpool nodes referenced by the as needed.
??? On the tree-ssa genericizing should take place here and we will avoid
need for these hooks (replacing them by genericizing hook)
cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. (build_cgraph_edges): Likewise. * cgraph.c (cgraph_node): Do not update assembler hash. (cgraph_remove_node): Drop non-unit-at-a-time code. * tree-pass.h (pass_O0_always_inline): Remove. * ipa-reference.c (gate_reference): Remove unit-at-a-time check. * toplev.c (process_options): Flag unit-at-a-time does not imply no section anchors. * cgraphunit.c: Update comments. (decide_is_function_needed): Drop non-unit-at-a-time mode. (cgraph_assemble_pending_functions): Remove. (cgraph_reset_node): Drop non-unit-at-a-time code. (cgraph_finalize_function): Likewise. (cgraph_analyze_function): Likewise. (cgraph_finalize_compilation_unit): Likewise. (cgraph_expand_function): Likewise. (cgraph_optimize): Likesise. (save_inline_function_body): Likewise. * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check. * tree-ssa-alias.c (maybe_be_aliased): Likewise. * ipa-inline.c: Update comments. (enum inlining_mode): remove INLINE_SPEED. (cgraph_clone_inlined_nodes): Drop unit-at-a-time check. (cgraph_mark_inline_edge): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. (cgraph_gate_inlining): Remove. (cgraph_early_inlining): Remove flag_unit_at_a_time checks. (cgraph_gate_early_inlining): Likewise. (gate_inline_passes): Remove. (pass_inline_parameters, pass_ipa_inline): Remove gates. (cgraph_gate_O0_always_inline, cgraph_O0_always_inline, pass_O0_always_inline): Remove. * c-pch.c (c_pch_matching): Remove -funit-at-a-time. * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check. * opts.c (no_unit_at_a_time_default): Remove. (decode_options): Remove flag_unit_at_a_time reset and warning. * opts.h (no_unit_at_a_time_default): Remove. * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword early in GNU dialect. (merge_decls): Update comment; drop unit-at-a-time check. (finish_decl): Likewise. (grok_declaration): Remove flag_inline_trees code. (finish_functions): Return on function returning non-void on all statics. * ipa-tye-escape.c (gate_type_escape_vars): Remove. * cfgexpand.c (expand_one_static_var): Remove. (expand_one_var): Remove expand_one_static_var call. (expand_used_vars_for_block): Remove flag_unit_a_time check. * c-opts.c (c_common_post_options): Remove flag_inline_trees code and flag_unit_at_a-time compatibility checks. * varasm.c (assemble_alias): Remove flag_unit_at_a_time check. * tree-inline.c (flag_inline_trees): Remove. (inlinable_function_p): Don't check it. (expand_call_inline): Remove non-unit-at-a-time code. * tree-inline.h (flag_inline_trees): Remove. * tree-optimize.c (execute_early_local_optimizations): Remove unit-at-a-time checks. (tree_rest_of_compilation): Likewise. * combine.c (setup_incoming_promotions): Likewise. * tree-profile.c (tree_gen_ic_func_profiler): Likewise. * tree-ssa-structalias.c (delete_points_to_sets): Likewise. * passes.c (pass_inline_parameters): Update comments; remove O0_alwaysinline pass. (execute_one_ipa_transform_pass): Do not reset in_gimple_form. (execute_one_pass): Likewise. * i386.c (ix86_function_regparm): Remove unit-at-a-time check. (ix86_function_sseregparm): Likewise. * arm.c (arm_function_in_section_p): Likewise. * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise. * varpool.c: Update comments. (decide_is_variable_needed): Remove unit-at-a-time checks. (varpool_finalize_decl): Likewise. * ada/utils.c (end_subprog_body): Remove inline trees check. * ada/misc.c (gnat_post_options): Do not set flag_inline_trees. * fortran/options.c (gfc_post_options): Remove flag_unline_trees code. * gcc.dg/winline-4.c: Remove. * gcc.dg/pch/valid-3.hs: Remove. * gcc.dg/pch/valid-3.c: Remove. * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning * g++.old-deja/g++.jason/report.C: Likewise. * testsuite/g++.dg/warn/pr23075.C: We get returning void warning instead of control flow warning. * cp/decl.c (duplicate_decls): Update comment and unit-at-a-time. (grogfndecl): Drop flag_inline_trees code. * cp/pt.c (instantiate_decl): Drop flag_iline_trees code. * cp/lex.c (cxx_init): Do not set unit-at-a-time. * java/decl.c: Include cgraph.h (end_java_method): Remove non-unit-at-a-time code. (java_mark_decl_local): Likewise; sanity check that we don't touch finalized nodes. From-SVN: r138140
2008-07-25 15:11:32 +02:00
Analyzing of all functions is deferred
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
to cgraph_finalize_compilation_unit and expansion into cgraph_optimize.
In cgraph_finalize_compilation_unit the reachable functions are
analyzed. During analysis the call-graph edges from reachable
functions are constructed and their destinations are marked as
reachable. References to functions and variables are discovered too
and variables found to be needed output to the assembly file. Via
mark_referenced call in assemble_variable functions referenced by
static variables are noticed too.
The intra-procedural information is produced and its existence
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
indicated by global_info_ready. Once this flag is set it is impossible
to change function from !reachable to reachable and thus
assemble_variable no longer call mark_referenced.
Finally the call-graph is topologically sorted and all reachable functions
that has not been completely inlined or are not external are output.
??? It is possible that reference to function or variable is optimized
out. We can not deal with this nicely because topological order is not
suitable for it. For tree-ssa we may consider another pass doing
optimization and re-discovering reachable functions.
??? Reorganize code so variables are output very last and only if they
really has been referenced by produced code, so we catch more cases
cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. (build_cgraph_edges): Likewise. * cgraph.c (cgraph_node): Do not update assembler hash. (cgraph_remove_node): Drop non-unit-at-a-time code. * tree-pass.h (pass_O0_always_inline): Remove. * ipa-reference.c (gate_reference): Remove unit-at-a-time check. * toplev.c (process_options): Flag unit-at-a-time does not imply no section anchors. * cgraphunit.c: Update comments. (decide_is_function_needed): Drop non-unit-at-a-time mode. (cgraph_assemble_pending_functions): Remove. (cgraph_reset_node): Drop non-unit-at-a-time code. (cgraph_finalize_function): Likewise. (cgraph_analyze_function): Likewise. (cgraph_finalize_compilation_unit): Likewise. (cgraph_expand_function): Likewise. (cgraph_optimize): Likesise. (save_inline_function_body): Likewise. * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check. * tree-ssa-alias.c (maybe_be_aliased): Likewise. * ipa-inline.c: Update comments. (enum inlining_mode): remove INLINE_SPEED. (cgraph_clone_inlined_nodes): Drop unit-at-a-time check. (cgraph_mark_inline_edge): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. (cgraph_gate_inlining): Remove. (cgraph_early_inlining): Remove flag_unit_at_a_time checks. (cgraph_gate_early_inlining): Likewise. (gate_inline_passes): Remove. (pass_inline_parameters, pass_ipa_inline): Remove gates. (cgraph_gate_O0_always_inline, cgraph_O0_always_inline, pass_O0_always_inline): Remove. * c-pch.c (c_pch_matching): Remove -funit-at-a-time. * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check. * opts.c (no_unit_at_a_time_default): Remove. (decode_options): Remove flag_unit_at_a_time reset and warning. * opts.h (no_unit_at_a_time_default): Remove. * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword early in GNU dialect. (merge_decls): Update comment; drop unit-at-a-time check. (finish_decl): Likewise. (grok_declaration): Remove flag_inline_trees code. (finish_functions): Return on function returning non-void on all statics. * ipa-tye-escape.c (gate_type_escape_vars): Remove. * cfgexpand.c (expand_one_static_var): Remove. (expand_one_var): Remove expand_one_static_var call. (expand_used_vars_for_block): Remove flag_unit_a_time check. * c-opts.c (c_common_post_options): Remove flag_inline_trees code and flag_unit_at_a-time compatibility checks. * varasm.c (assemble_alias): Remove flag_unit_at_a_time check. * tree-inline.c (flag_inline_trees): Remove. (inlinable_function_p): Don't check it. (expand_call_inline): Remove non-unit-at-a-time code. * tree-inline.h (flag_inline_trees): Remove. * tree-optimize.c (execute_early_local_optimizations): Remove unit-at-a-time checks. (tree_rest_of_compilation): Likewise. * combine.c (setup_incoming_promotions): Likewise. * tree-profile.c (tree_gen_ic_func_profiler): Likewise. * tree-ssa-structalias.c (delete_points_to_sets): Likewise. * passes.c (pass_inline_parameters): Update comments; remove O0_alwaysinline pass. (execute_one_ipa_transform_pass): Do not reset in_gimple_form. (execute_one_pass): Likewise. * i386.c (ix86_function_regparm): Remove unit-at-a-time check. (ix86_function_sseregparm): Likewise. * arm.c (arm_function_in_section_p): Likewise. * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise. * varpool.c: Update comments. (decide_is_variable_needed): Remove unit-at-a-time checks. (varpool_finalize_decl): Likewise. * ada/utils.c (end_subprog_body): Remove inline trees check. * ada/misc.c (gnat_post_options): Do not set flag_inline_trees. * fortran/options.c (gfc_post_options): Remove flag_unline_trees code. * gcc.dg/winline-4.c: Remove. * gcc.dg/pch/valid-3.hs: Remove. * gcc.dg/pch/valid-3.c: Remove. * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning * g++.old-deja/g++.jason/report.C: Likewise. * testsuite/g++.dg/warn/pr23075.C: We get returning void warning instead of control flow warning. * cp/decl.c (duplicate_decls): Update comment and unit-at-a-time. (grogfndecl): Drop flag_inline_trees code. * cp/pt.c (instantiate_decl): Drop flag_iline_trees code. * cp/lex.c (cxx_init): Do not set unit-at-a-time. * java/decl.c: Include cgraph.h (end_java_method): Remove non-unit-at-a-time code. (java_mark_decl_local): Likewise; sanity check that we don't touch finalized nodes. From-SVN: r138140
2008-07-25 15:11:32 +02:00
where reference has been optimized out. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
#include "rtl.h"
#include "tree-flow.h"
#include "tree-inline.h"
#include "langhooks.h"
#include "pointer-set.h"
#include "toplev.h"
#include "flags.h"
#include "ggc.h"
#include "debug.h"
#include "target.h"
#include "cgraph.h"
#include "diagnostic.h"
#include "timevar.h"
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
#include "params.h"
#include "fibheap.h"
#include "intl.h"
#include "function.h"
#include "ipa-prop.h"
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
#include "gimple.h"
#include "tree-iterator.h"
#include "tree-pass.h"
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
#include "tree-dump.h"
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
#include "output.h"
#include "coverage.h"
cgraphunit.c (plugin.h): Include. 2009-12-01 Grigori Fursin <grigori.fursin@inria.fr> Joern Rennecke <amylaar@spamcop.net> * cgraphunit.c (plugin.h): Include. (ipa_passes): Invoke PLUGIN_ALL_IPA_PASSES_START / PLUGIN_ALL_IPA_PASSES_END at start / end of processing. * gcc-plugin.h (highlev-plugin-common.h, hashtab.h): Include. (enum plugin_event): Define by including plugin.def. Last enumerator is now called PLUGIN_EVENT_FIRST_DYNAMIC. (plugin_event_name): Change type to const char **. (get_event_last, get_named_event_id, unregister_callback): Declare. (register_callback): Change type of event argument to int. (highlev-plugin-common.h): New file. * Makefile.in (GCC_PLUGIN_H): Add highlev-plugin-common.h and $(HASHTAB_H) (tree-optimize.o passes.o): Depend on $(PLUGIN_H). (PLUGIN_HEADERS): Add opts.h, $(PARAMS_H) and plugin.def. (s-header-vars): New rule. (install-plugin): Depend on s-header-vars. Install b-header-vars. * params.c (get_num_compiler_params): New function. * params.h (get_num_compiler_params): Declare. * passes.c (plugin.h): Include. (make_pass_instance): Invoke PLUGIN_NEW_PASS. (do_per_function_toporder, pass_init_dump_file): No longer static. (pass_fini_dump_file): Likewise. (execute_one_pass): Likewise. Invoke PLUGIN_OVERRIDE_GATE and PLUGIN_PASS_EXECUTION. (execute_ipa_pass_list): Invoke PLUGIN_EARLY_GIMPLE_PASSES_START and PLUGIN_EARLY_GIMPLE_PASSES_END. * plugin.c (plugin_event_name_init): New array, defined by including plugin.def. (FMT_FOR_PLUGIN_EVENT): Update. (plugin_event_name): Change type to const char ** and initialize to plugin_event_name_init. (event_tab, event_last, event_horizon): New variable. (get_event_last): New function. (plugin_callbacks_init): New array. (plugin_callbacks: Change type to struct callback_info **. Initialize to plugin_callbacks_init. (htab_event_eq, get_named_event_id, unregister_callback): New function. (invoke_plugin_va_callbacks): Likewise. (register_callback): Change type of event argument to int. Handle new events. Allow dynamic events. (invoke_plugin_callbacks): Likewise. Return success status. (plugins_active_p): Allow dynamic callbacks. * plugin.def: New file. * plugin.h (invoke_plugin_callbacks): Update prototype. (invoke_plugin_va_callbacks): Declare. * tree-optimize.c (plugin.h): Include. (tree_rest_of_compilation): Invoke PLUGIN_ALL_PASSES_START and PLUGIN_ALL_PASSES_END. * tree-pass.h (execute_one_pass, pass_init_dump_file): Declare. (pass_fini_dump_file, do_per_function_toporder): Likewise. * doc/plugin.texi: Document new event types. Co-Authored-By: Joern Rennecke <amylaar@spamcop.net> From-SVN: r154877
2009-12-01 20:12:29 +01:00
#include "plugin.h"
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
static void cgraph_expand_all_functions (void);
static void cgraph_mark_functions_to_output (void);
static void cgraph_expand_function (struct cgraph_node *);
static void cgraph_output_pending_asms (void);
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
static void cgraph_analyze_function (struct cgraph_node *);
static FILE *cgraph_dump_file;
/* A vector of FUNCTION_DECLs declared as static constructors. */
static GTY (()) VEC(tree, gc) *static_ctors;
/* A vector of FUNCTION_DECLs declared as static destructors. */
static GTY (()) VEC(tree, gc) *static_dtors;
/* Used for vtable lookup in thunk adjusting. */
static GTY (()) tree vtable_entry_type;
/* When target does not have ctors and dtors, we call all constructor
and destructor by special initialization/destruction function
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
recognized by collect2.
When we are going to build this function, collect all constructors and
destructors and turn them into normal functions. */
static void
record_cdtor_fn (tree fndecl)
{
struct cgraph_node *node;
if (targetm.have_ctors_dtors
|| (!DECL_STATIC_CONSTRUCTOR (fndecl)
&& !DECL_STATIC_DESTRUCTOR (fndecl)))
return;
if (DECL_STATIC_CONSTRUCTOR (fndecl))
{
VEC_safe_push (tree, gc, static_ctors, fndecl);
DECL_STATIC_CONSTRUCTOR (fndecl) = 0;
}
if (DECL_STATIC_DESTRUCTOR (fndecl))
{
VEC_safe_push (tree, gc, static_dtors, fndecl);
DECL_STATIC_DESTRUCTOR (fndecl) = 0;
}
node = cgraph_node (fndecl);
node->local.disregard_inline_limits = 1;
cgraph_mark_reachable_node (node);
}
/* Define global constructors/destructor functions for the CDTORS, of
which they are LEN. The CDTORS are sorted by initialization
priority. If CTOR_P is true, these are constructors; otherwise,
they are destructors. */
static void
build_cdtor (bool ctor_p, tree *cdtors, size_t len)
{
size_t i;
i = 0;
while (i < len)
{
tree body;
tree fn;
priority_type priority;
priority = 0;
body = NULL_TREE;
/* Find the next batch of constructors/destructors with the same
initialization priority. */
do
{
priority_type p;
fn = cdtors[i];
p = ctor_p ? DECL_INIT_PRIORITY (fn) : DECL_FINI_PRIORITY (fn);
if (!body)
priority = p;
else if (p != priority)
break;
re PR c/40435 (Revision 148442 caused many regressions on trunk) 2009-07-17 Aldy Hernandez <aldyh@redhat.com> Manuel López-Ibáñez <manu@gcc.gnu.org> PR 40435 * tree-complex.c, tree-loop-distribution.c, tree.c, tree.h, builtins.c, fold-const.c, omp-low.c, cgraphunit.c, tree-ssa-ccp.c, tree-ssa-dom.c, gimple-low.c, expr.c, tree-ssa-ifcombine.c, c-decl.c, stor-layout.c, tree-if-conv.c, c-typeck.c, gimplify.c, calls.c, tree-sra.c, tree-mudflap.c, tree-ssa-copy.c, tree-ssa-forwprop.c, c-convert.c, c-omp.c, varasm.c, tree-inline.c, c-common.c, c-common.h, gimple.c, tree-switch-conversion.c, gimple.h, tree-cfg.c, c-parser.c, convert.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. objc/ * objc-act.c: Add location argument to all calls to build_fold_addr_expr. testsuite/ * gcc.dg/pr36902.c: Add column info. * g++.dg/gcov/gcov-2.C: Change count for definition. cp/ * typeck.c, init.c, class.c, method.c, rtti.c, except.c, error.c, tree.c, cp-gimplify.c, cxx-pretty-print.c, pt.c, semantics.c, call.c, cvt.c, mangle.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. fortran/ * trans-expr.c, trans-array.c, trans-openmp.c, trans-stmt.c, trans.c, trans-io.c, trans-decl.c, trans-intrinsic.c: Add location argument to fold_{unary,binary,ternary}, fold_build[123], build_call_expr, build_size_arg, build_fold_addr_expr, build_call_array, non_lvalue, size_diffop, fold_build1_initializer, fold_build2_initializer, fold_build3_initializer, fold_build_call_array, fold_build_call_array_initializer, fold_single_bit_test, omit_one_operand, omit_two_operands, invert_truthvalue, fold_truth_not_expr, build_fold_indirect_ref, fold_indirect_ref, combine_comparisons, fold_builtin_*, fold_call_expr, build_range_check, maybe_fold_offset_to_address, round_up, round_down. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r149722
2009-07-17 00:29:52 +02:00
append_to_statement_list (build_function_call_expr (UNKNOWN_LOCATION,
fn, 0),
&body);
++i;
}
while (i < len);
gcc_assert (body != NULL_TREE);
/* Generate a function to call all the function of like
priority. */
cgraph_build_static_cdtor (ctor_p ? 'I' : 'D', body, priority);
}
}
/* Comparison function for qsort. P1 and P2 are actually of type
"tree *" and point to static constructors. DECL_INIT_PRIORITY is
used to determine the sort order. */
static int
compare_ctor (const void *p1, const void *p2)
{
tree f1;
tree f2;
int priority1;
int priority2;
f1 = *(const tree *)p1;
f2 = *(const tree *)p2;
priority1 = DECL_INIT_PRIORITY (f1);
priority2 = DECL_INIT_PRIORITY (f2);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (priority1 < priority2)
return -1;
else if (priority1 > priority2)
return 1;
else
/* Ensure a stable sort. */
return (const tree *)p1 - (const tree *)p2;
}
/* Comparison function for qsort. P1 and P2 are actually of type
"tree *" and point to static destructors. DECL_FINI_PRIORITY is
used to determine the sort order. */
static int
compare_dtor (const void *p1, const void *p2)
{
tree f1;
tree f2;
int priority1;
int priority2;
f1 = *(const tree *)p1;
f2 = *(const tree *)p2;
priority1 = DECL_FINI_PRIORITY (f1);
priority2 = DECL_FINI_PRIORITY (f2);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (priority1 < priority2)
return -1;
else if (priority1 > priority2)
return 1;
else
/* Ensure a stable sort. */
return (const tree *)p1 - (const tree *)p2;
}
/* Generate functions to call static constructors and destructors
for targets that do not support .ctors/.dtors sections. These
functions have magic names which are detected by collect2. */
static void
cgraph_build_cdtor_fns (void)
{
if (!VEC_empty (tree, static_ctors))
{
gcc_assert (!targetm.have_ctors_dtors);
qsort (VEC_address (tree, static_ctors),
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
VEC_length (tree, static_ctors),
sizeof (tree),
compare_ctor);
build_cdtor (/*ctor_p=*/true,
VEC_address (tree, static_ctors),
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
VEC_length (tree, static_ctors));
VEC_truncate (tree, static_ctors, 0);
}
if (!VEC_empty (tree, static_dtors))
{
gcc_assert (!targetm.have_ctors_dtors);
qsort (VEC_address (tree, static_dtors),
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
VEC_length (tree, static_dtors),
sizeof (tree),
compare_dtor);
build_cdtor (/*ctor_p=*/false,
VEC_address (tree, static_dtors),
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
VEC_length (tree, static_dtors));
VEC_truncate (tree, static_dtors, 0);
}
}
/* Determine if function DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. (build_cgraph_edges): Likewise. * cgraph.c (cgraph_node): Do not update assembler hash. (cgraph_remove_node): Drop non-unit-at-a-time code. * tree-pass.h (pass_O0_always_inline): Remove. * ipa-reference.c (gate_reference): Remove unit-at-a-time check. * toplev.c (process_options): Flag unit-at-a-time does not imply no section anchors. * cgraphunit.c: Update comments. (decide_is_function_needed): Drop non-unit-at-a-time mode. (cgraph_assemble_pending_functions): Remove. (cgraph_reset_node): Drop non-unit-at-a-time code. (cgraph_finalize_function): Likewise. (cgraph_analyze_function): Likewise. (cgraph_finalize_compilation_unit): Likewise. (cgraph_expand_function): Likewise. (cgraph_optimize): Likesise. (save_inline_function_body): Likewise. * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check. * tree-ssa-alias.c (maybe_be_aliased): Likewise. * ipa-inline.c: Update comments. (enum inlining_mode): remove INLINE_SPEED. (cgraph_clone_inlined_nodes): Drop unit-at-a-time check. (cgraph_mark_inline_edge): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. (cgraph_gate_inlining): Remove. (cgraph_early_inlining): Remove flag_unit_at_a_time checks. (cgraph_gate_early_inlining): Likewise. (gate_inline_passes): Remove. (pass_inline_parameters, pass_ipa_inline): Remove gates. (cgraph_gate_O0_always_inline, cgraph_O0_always_inline, pass_O0_always_inline): Remove. * c-pch.c (c_pch_matching): Remove -funit-at-a-time. * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check. * opts.c (no_unit_at_a_time_default): Remove. (decode_options): Remove flag_unit_at_a_time reset and warning. * opts.h (no_unit_at_a_time_default): Remove. * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword early in GNU dialect. (merge_decls): Update comment; drop unit-at-a-time check. (finish_decl): Likewise. (grok_declaration): Remove flag_inline_trees code. (finish_functions): Return on function returning non-void on all statics. * ipa-tye-escape.c (gate_type_escape_vars): Remove. * cfgexpand.c (expand_one_static_var): Remove. (expand_one_var): Remove expand_one_static_var call. (expand_used_vars_for_block): Remove flag_unit_a_time check. * c-opts.c (c_common_post_options): Remove flag_inline_trees code and flag_unit_at_a-time compatibility checks. * varasm.c (assemble_alias): Remove flag_unit_at_a_time check. * tree-inline.c (flag_inline_trees): Remove. (inlinable_function_p): Don't check it. (expand_call_inline): Remove non-unit-at-a-time code. * tree-inline.h (flag_inline_trees): Remove. * tree-optimize.c (execute_early_local_optimizations): Remove unit-at-a-time checks. (tree_rest_of_compilation): Likewise. * combine.c (setup_incoming_promotions): Likewise. * tree-profile.c (tree_gen_ic_func_profiler): Likewise. * tree-ssa-structalias.c (delete_points_to_sets): Likewise. * passes.c (pass_inline_parameters): Update comments; remove O0_alwaysinline pass. (execute_one_ipa_transform_pass): Do not reset in_gimple_form. (execute_one_pass): Likewise. * i386.c (ix86_function_regparm): Remove unit-at-a-time check. (ix86_function_sseregparm): Likewise. * arm.c (arm_function_in_section_p): Likewise. * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise. * varpool.c: Update comments. (decide_is_variable_needed): Remove unit-at-a-time checks. (varpool_finalize_decl): Likewise. * ada/utils.c (end_subprog_body): Remove inline trees check. * ada/misc.c (gnat_post_options): Do not set flag_inline_trees. * fortran/options.c (gfc_post_options): Remove flag_unline_trees code. * gcc.dg/winline-4.c: Remove. * gcc.dg/pch/valid-3.hs: Remove. * gcc.dg/pch/valid-3.c: Remove. * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning * g++.old-deja/g++.jason/report.C: Likewise. * testsuite/g++.dg/warn/pr23075.C: We get returning void warning instead of control flow warning. * cp/decl.c (duplicate_decls): Update comment and unit-at-a-time. (grogfndecl): Drop flag_inline_trees code. * cp/pt.c (instantiate_decl): Drop flag_iline_trees code. * cp/lex.c (cxx_init): Do not set unit-at-a-time. * java/decl.c: Include cgraph.h (end_java_method): Remove non-unit-at-a-time code. (java_mark_decl_local): Likewise; sanity check that we don't touch finalized nodes. From-SVN: r138140
2008-07-25 15:11:32 +02:00
configury. */
bool
cgraph_decide_is_function_needed (struct cgraph_node *node, tree decl)
{
/* If the user told us it is used, then it must be so. */
if (node->local.externally_visible)
return true;
/* ??? If the assembler name is set by hand, it is possible to assemble
the name later after finalizing the function and the fact is noticed
in assemble_name then. This is arguably a bug. */
if (DECL_ASSEMBLER_NAME_SET_P (decl)
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
return true;
/* With -fkeep-inline-functions we are keeping all inline functions except
for extern inline ones. */
if (flag_keep_inline_functions
&& DECL_DECLARED_INLINE_P (decl)
&& !DECL_EXTERNAL (decl)
&& !lookup_attribute ("always_inline", DECL_ATTRIBUTES (decl)))
return true;
/* If we decided it was needed before, but at the time we didn't have
the body of the function available, then it's still needed. We have
to go back and re-check its dependencies now. */
if (node->needed)
return true;
/* Externally visible functions must be output. The exception is
2006-05-19 00:16:23 +02:00
COMDAT functions that must be output only when they are needed.
When not optimizing, also output the static functions. (see
PR24561), but don't do so for always_inline functions, functions
declared inline and nested functions. These was optimized out
in the original implementation and it is unclear whether we want
to change the behavior here. */
if (((TREE_PUBLIC (decl)
|| (!optimize && !node->local.disregard_inline_limits
&& !DECL_DECLARED_INLINE_P (decl)
&& !node->origin))
lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has no address taken. * 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. From-SVN: r152520
2009-10-07 11:01:16 +02:00
&& !flag_whole_program
&& !flag_lto
&& !flag_whopr)
&& !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
return true;
/* Constructors and destructors are reachable from the runtime by
some mechanism. */
if (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl))
return true;
return false;
}
/* Process CGRAPH_NEW_FUNCTIONS and perform actions necessary to add these
functions into callgraph in a way so they look like ordinary reachable
functions inserted into callgraph already at construction time. */
bool
cgraph_process_new_functions (void)
{
bool output = false;
tree fndecl;
struct cgraph_node *node;
* lto-symtab.c (lto_symtab_entry_def) Add vnode. (lto_varpool_replace_node): New. (lto_symtab_resolve_symbols): Resolve varpool nodes. (lto_symtab_merge_decls_1): Prefer decls with varpool node. (lto_symtab_merge_cgraph_nodes_1): Merge varpools. * cgraph.h (varpool_node_ptr): New type. (varpool_node_ptr): New vector. (varpool_node_set_def): New structure. (varpool_node_set): New type. (varpool_node_set): New vector. (varpool_node_set_element_def): New structure. (varpool_node_set_element, const_varpool_node_set_element): New types. (varpool_node_set_iterator): New type. (varpool_node): Add prev pointers, add used_from_other_partition, in_other_partition. (varpool_node_set_new, varpool_node_set_find, varpool_node_set_add, varpool_node_set_remove, dump_varpool_node_set, debug_varpool_node_set, varpool_get_node, varpool_remove_node): Declare. (vsi_end_p, vsi_next, vsi_node, vsi_start, varpool_node_in_set_p, varpool_node_set_size): New inlines. * cgraph.c (dump_cgraph_node): Dump asm names of aliases. * tree-pass.h (varpool_node_set_def): Forward declare. (ipa_opt_pass_d): Summary writting takes vnode sets too. (ipa_write_optimization_summaries): Update prototype. * ipa-cp.c (ipcp_write_summary): Update. * ipa-reference.c (ipa_reference_write_summary): Update. * lto-cgraph.c (lto_output_varpool_node): New static function. (output_varpool): New function. (input_varpool_node): New static function. (input_varpool_1): New function. (input_cgraph): Input varpool. * ipa-pure-const.c (pure_const_write_summary): Update. * lto-streamer-out.c (lto_output): Update, output varpool too. (write_global_stream): Kill WPA hack. (produce_asm_for_decls): Update. (output_alias_pair_p): Handle variables. (output_unreferenced_globals): Output only needed partition of varpool. * ipa-inline.c (inline_write_summary): Update. * lto-streamer-in.c (lto_input_tree_ref, lto_input_tree): Do not build cgraph. * lto-section-in.c (lto_section_name): Add varpool and jump funcs. * ipa.c (hash_varpool_node_set_element, eq_varpool_node_set_element, varpool_node_set_new, varpool_node_set_add, varpool_node_set_remove, varpool_node_set_find, dump_varpool_node_set, debug_varpool_node_set): New functions. * passes.c (rest_of_decl_compilation): when in LTO do not finalize. (execute_one_pass): Process new decls too. (ipa_write_summaries_2): Pass around vsets. (ipa_write_summaries_1): Likewise. (ipa_write_summaries): Build vset; be more selective about cgraph nodes to add. (ipa_write_optimization_summaries_1): Pass around vsets. (ipa_write_optimization_summaries): Likewise. * varpool.c (varpool_get_node): New. (varpool_node): Update doubly linked lists. (varpool_remove_node): New. (dump_varpool_node): More dumping. (varpool_enqueue_needed_node): Update doubly linked lists. (decide_is_variable_needed): Kill ltrans hack. (varpool_finalize_decl): Kill lto hack. (varpool_assemble_decl): Skip decls in other partitions. (varpool_assemble_pending_decls): Update doubly linkes lists. (varpool_empty_needed_queue): Likewise. (varpool_extra_name_alias): Likewise. * lto-streamer.c (lto_get_section_name): Add vars section. * lto-streamer.h (lto_section_type): Update. (output_varpool, input_varpool): Declare. * lto.c (lto_varpool_node_sets): New. (lto_1_to_1_map): Partition varpool too. (globalize_context_t, globalize_cross_file_statics, lto_scan_statics_in_ref_table, lto_scan_statics_in_cgraph_node, lto_scan_statics_in_remaining_global_vars): Remove. (lto_promote_cross_file_statics): Rewrite. (get_filename_for_set): Take vset argument. (lto_wpa_write_files): Pass around vsets. From-SVN: r158854
2010-04-29 09:10:38 +02:00
varpool_analyze_pending_decls ();
/* Note that this queue may grow as its being processed, as the new
functions may generate new ones. */
while (cgraph_new_nodes)
{
node = cgraph_new_nodes;
fndecl = node->decl;
cgraph_new_nodes = cgraph_new_nodes->next_needed;
switch (cgraph_state)
{
case CGRAPH_STATE_CONSTRUCTION:
/* At construction time we just need to finalize function and move
it into reachable functions list. */
node->next_needed = NULL;
cgraph_finalize_function (fndecl, false);
cgraph_mark_reachable_node (node);
output = true;
break;
case CGRAPH_STATE_IPA:
2007-01-03 02:12:56 +01:00
case CGRAPH_STATE_IPA_SSA:
/* When IPA optimization already started, do all essential
transformations that has been already performed on the whole
cgraph but not on this function. */
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple_register_cfg_hooks ();
if (!node->analyzed)
cgraph_analyze_function (node);
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
current_function_decl = fndecl;
compute_inline_parameters (node);
2007-01-03 02:12:56 +01:00
if ((cgraph_state == CGRAPH_STATE_IPA_SSA
&& !gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)))
/* When not optimizing, be sure we run early local passes anyway
to expand OMP. */
|| !optimize)
re PR other/35094 (RTL dump file letters hosed and partly undocumented) * gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-03-19 12:22:40 +01:00
execute_pass_list (pass_early_local_passes.pass.sub);
free_dominance_info (CDI_POST_DOMINATORS);
free_dominance_info (CDI_DOMINATORS);
pop_cfun ();
current_function_decl = NULL;
break;
case CGRAPH_STATE_EXPANSION:
/* Functions created during expansion shall be compiled
directly. */
node->process = 0;
cgraph_expand_function (node);
break;
default:
gcc_unreachable ();
break;
}
cgraph.c (first_cgraph_function_insertion_hook): New variable. * cgraph.c (first_cgraph_function_insertion_hook): New variable. (cgraph_add_function_insertion_hook, cgraph_remove_function_insertion_hook, cgraph_call_function_insertion_hooks): New functions. * cgraph.h (cgraph_add_function_insertion_hook, cgraph_remove_function_insertion_hook, cgraph_call_function_insertion_hooks): Declare. * ipa-reference.c (function_insertion_hook_holder): New variable. (check_operand, look_for_address_of): When checking late, do not care about module bitmaps. (add_new_function): New function. (generate_summary): Register hooks; zero module bitmaps. (propagate): Unregister hooks. * ipa-pure-const.c (function_insertion_hook_holder): New variable. (add_new_function): New function. (generate_summary): Register hook. (propagate): Remove hook. * ipa-cp.c (ipcp_need_redirect_p): Fix to not be constant 0. * tree-pass.h (pass_ipa_cp): Make ipa_opt_pass. * ipa-cp.c (ipcp_update_cloned_node): New function. (build_const_val): Handle functions correctly; bring type logic into sync with tree-inline.c (ipcp_init_stage): Take care of computing stuff needed by indirect inlining; update clones. (ipcp_generate_summary): Break out of ipcp_driver. (ipcp_driver): Do only execution and transformation. (pass_ipa_cp): Make IPA_PASS. * tree-ssa-ccp.c (fold_stmt_r): Check type before trying to fold offset to address. * ipa-inline.c (inline_indirect_intraprocedural_analysis): When doing ipcp, some info is already available. * ipa-prop.c (ipa_count_arguments): Grow edge lists as needed. * tree-inline.c (remap_ssa_name): Unshare expression. From-SVN: r139389
2008-08-21 17:26:59 +02:00
cgraph_call_function_insertion_hooks (node);
* lto-symtab.c (lto_symtab_entry_def) Add vnode. (lto_varpool_replace_node): New. (lto_symtab_resolve_symbols): Resolve varpool nodes. (lto_symtab_merge_decls_1): Prefer decls with varpool node. (lto_symtab_merge_cgraph_nodes_1): Merge varpools. * cgraph.h (varpool_node_ptr): New type. (varpool_node_ptr): New vector. (varpool_node_set_def): New structure. (varpool_node_set): New type. (varpool_node_set): New vector. (varpool_node_set_element_def): New structure. (varpool_node_set_element, const_varpool_node_set_element): New types. (varpool_node_set_iterator): New type. (varpool_node): Add prev pointers, add used_from_other_partition, in_other_partition. (varpool_node_set_new, varpool_node_set_find, varpool_node_set_add, varpool_node_set_remove, dump_varpool_node_set, debug_varpool_node_set, varpool_get_node, varpool_remove_node): Declare. (vsi_end_p, vsi_next, vsi_node, vsi_start, varpool_node_in_set_p, varpool_node_set_size): New inlines. * cgraph.c (dump_cgraph_node): Dump asm names of aliases. * tree-pass.h (varpool_node_set_def): Forward declare. (ipa_opt_pass_d): Summary writting takes vnode sets too. (ipa_write_optimization_summaries): Update prototype. * ipa-cp.c (ipcp_write_summary): Update. * ipa-reference.c (ipa_reference_write_summary): Update. * lto-cgraph.c (lto_output_varpool_node): New static function. (output_varpool): New function. (input_varpool_node): New static function. (input_varpool_1): New function. (input_cgraph): Input varpool. * ipa-pure-const.c (pure_const_write_summary): Update. * lto-streamer-out.c (lto_output): Update, output varpool too. (write_global_stream): Kill WPA hack. (produce_asm_for_decls): Update. (output_alias_pair_p): Handle variables. (output_unreferenced_globals): Output only needed partition of varpool. * ipa-inline.c (inline_write_summary): Update. * lto-streamer-in.c (lto_input_tree_ref, lto_input_tree): Do not build cgraph. * lto-section-in.c (lto_section_name): Add varpool and jump funcs. * ipa.c (hash_varpool_node_set_element, eq_varpool_node_set_element, varpool_node_set_new, varpool_node_set_add, varpool_node_set_remove, varpool_node_set_find, dump_varpool_node_set, debug_varpool_node_set): New functions. * passes.c (rest_of_decl_compilation): when in LTO do not finalize. (execute_one_pass): Process new decls too. (ipa_write_summaries_2): Pass around vsets. (ipa_write_summaries_1): Likewise. (ipa_write_summaries): Build vset; be more selective about cgraph nodes to add. (ipa_write_optimization_summaries_1): Pass around vsets. (ipa_write_optimization_summaries): Likewise. * varpool.c (varpool_get_node): New. (varpool_node): Update doubly linked lists. (varpool_remove_node): New. (dump_varpool_node): More dumping. (varpool_enqueue_needed_node): Update doubly linked lists. (decide_is_variable_needed): Kill ltrans hack. (varpool_finalize_decl): Kill lto hack. (varpool_assemble_decl): Skip decls in other partitions. (varpool_assemble_pending_decls): Update doubly linkes lists. (varpool_empty_needed_queue): Likewise. (varpool_extra_name_alias): Likewise. * lto-streamer.c (lto_get_section_name): Add vars section. * lto-streamer.h (lto_section_type): Update. (output_varpool, input_varpool): Declare. * lto.c (lto_varpool_node_sets): New. (lto_1_to_1_map): Partition varpool too. (globalize_context_t, globalize_cross_file_statics, lto_scan_statics_in_ref_table, lto_scan_statics_in_cgraph_node, lto_scan_statics_in_remaining_global_vars): Remove. (lto_promote_cross_file_statics): Rewrite. (get_filename_for_set): Take vset argument. (lto_wpa_write_files): Pass around vsets. From-SVN: r158854
2010-04-29 09:10:38 +02:00
varpool_analyze_pending_decls ();
}
return output;
}
/* As an GCC extension we allow redefinition of the function. The
semantics when both copies of bodies differ is not well defined.
We replace the old body with new body so in unit at a time mode
we always use new body, while in normal mode we may end up with
old body inlined into some functions and new body expanded and
inlined in others.
??? It may make more sense to use one body for inlining and other
body for expanding the function but this is difficult to do. */
static void
cgraph_reset_node (struct cgraph_node *node)
{
/* If node->process is set, then we have already begun whole-unit analysis.
cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. (build_cgraph_edges): Likewise. * cgraph.c (cgraph_node): Do not update assembler hash. (cgraph_remove_node): Drop non-unit-at-a-time code. * tree-pass.h (pass_O0_always_inline): Remove. * ipa-reference.c (gate_reference): Remove unit-at-a-time check. * toplev.c (process_options): Flag unit-at-a-time does not imply no section anchors. * cgraphunit.c: Update comments. (decide_is_function_needed): Drop non-unit-at-a-time mode. (cgraph_assemble_pending_functions): Remove. (cgraph_reset_node): Drop non-unit-at-a-time code. (cgraph_finalize_function): Likewise. (cgraph_analyze_function): Likewise. (cgraph_finalize_compilation_unit): Likewise. (cgraph_expand_function): Likewise. (cgraph_optimize): Likesise. (save_inline_function_body): Likewise. * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check. * tree-ssa-alias.c (maybe_be_aliased): Likewise. * ipa-inline.c: Update comments. (enum inlining_mode): remove INLINE_SPEED. (cgraph_clone_inlined_nodes): Drop unit-at-a-time check. (cgraph_mark_inline_edge): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. (cgraph_gate_inlining): Remove. (cgraph_early_inlining): Remove flag_unit_at_a_time checks. (cgraph_gate_early_inlining): Likewise. (gate_inline_passes): Remove. (pass_inline_parameters, pass_ipa_inline): Remove gates. (cgraph_gate_O0_always_inline, cgraph_O0_always_inline, pass_O0_always_inline): Remove. * c-pch.c (c_pch_matching): Remove -funit-at-a-time. * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check. * opts.c (no_unit_at_a_time_default): Remove. (decode_options): Remove flag_unit_at_a_time reset and warning. * opts.h (no_unit_at_a_time_default): Remove. * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword early in GNU dialect. (merge_decls): Update comment; drop unit-at-a-time check. (finish_decl): Likewise. (grok_declaration): Remove flag_inline_trees code. (finish_functions): Return on function returning non-void on all statics. * ipa-tye-escape.c (gate_type_escape_vars): Remove. * cfgexpand.c (expand_one_static_var): Remove. (expand_one_var): Remove expand_one_static_var call. (expand_used_vars_for_block): Remove flag_unit_a_time check. * c-opts.c (c_common_post_options): Remove flag_inline_trees code and flag_unit_at_a-time compatibility checks. * varasm.c (assemble_alias): Remove flag_unit_at_a_time check. * tree-inline.c (flag_inline_trees): Remove. (inlinable_function_p): Don't check it. (expand_call_inline): Remove non-unit-at-a-time code. * tree-inline.h (flag_inline_trees): Remove. * tree-optimize.c (execute_early_local_optimizations): Remove unit-at-a-time checks. (tree_rest_of_compilation): Likewise. * combine.c (setup_incoming_promotions): Likewise. * tree-profile.c (tree_gen_ic_func_profiler): Likewise. * tree-ssa-structalias.c (delete_points_to_sets): Likewise. * passes.c (pass_inline_parameters): Update comments; remove O0_alwaysinline pass. (execute_one_ipa_transform_pass): Do not reset in_gimple_form. (execute_one_pass): Likewise. * i386.c (ix86_function_regparm): Remove unit-at-a-time check. (ix86_function_sseregparm): Likewise. * arm.c (arm_function_in_section_p): Likewise. * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise. * varpool.c: Update comments. (decide_is_variable_needed): Remove unit-at-a-time checks. (varpool_finalize_decl): Likewise. * ada/utils.c (end_subprog_body): Remove inline trees check. * ada/misc.c (gnat_post_options): Do not set flag_inline_trees. * fortran/options.c (gfc_post_options): Remove flag_unline_trees code. * gcc.dg/winline-4.c: Remove. * gcc.dg/pch/valid-3.hs: Remove. * gcc.dg/pch/valid-3.c: Remove. * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning * g++.old-deja/g++.jason/report.C: Likewise. * testsuite/g++.dg/warn/pr23075.C: We get returning void warning instead of control flow warning. * cp/decl.c (duplicate_decls): Update comment and unit-at-a-time. (grogfndecl): Drop flag_inline_trees code. * cp/pt.c (instantiate_decl): Drop flag_iline_trees code. * cp/lex.c (cxx_init): Do not set unit-at-a-time. * java/decl.c: Include cgraph.h (end_java_method): Remove non-unit-at-a-time code. (java_mark_decl_local): Likewise; sanity check that we don't touch finalized nodes. From-SVN: r138140
2008-07-25 15:11:32 +02:00
This is *not* testing for whether we've already emitted the function.
That case can be sort-of legitimately seen with real function redefinition
errors. I would argue that the front end should never present us with
such a case, but don't enforce that for now. */
gcc_assert (!node->process);
/* Reset our data structures so we can analyze the function again. */
memset (&node->local, 0, sizeof (node->local));
memset (&node->global, 0, sizeof (node->global));
memset (&node->rtl, 0, sizeof (node->rtl));
node->analyzed = false;
node->local.redefined_extern_inline = true;
node->local.finalized = false;
cgraph_node_remove_callees (node);
/* We may need to re-queue the node for assembling in case
we already proceeded it and ignored as not needed or got
a re-declaration in IMA mode. */
if (node->reachable)
{
struct cgraph_node *n;
for (n = cgraph_nodes_queue; n; n = n->next_needed)
if (n == node)
break;
if (!n)
node->reachable = 0;
}
}
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
static void
cgraph_lower_function (struct cgraph_node *node)
{
if (node->lowered)
return;
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
if (node->nested)
lower_nested_functions (node->decl);
gcc_assert (!node->nested);
[multiple changes] 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * libgomp: New directory. * Makefile.def: Add target_module libgomp. * Makefile.in: Regenerate. * configure.in (target_libraries): Add target-libgomp. * configure: Regenerate. contrib/ 2006-01-18 Richard Henderson <rth@redhat.com> Diego Novillo <dnovillo@redhat.com> * gcc_update (files_and_dependencies): Add libgomp files. gcc/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * omp-low.c: New file. * c-omp.c: New file. 2006-01-18 Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * doc/invoke.texi: Document -fopenmp. * tree-dump.h (debug_function): Declare. * hooks.c (hook_bool_tree_bool_false): New function. (hook_tree_tree_null): Remove. (hook_tree_tree_tree_null): New. * hooks.h: Update to match. * tree-pretty-print.c (debug_tree_chain): New. (print_generic_expr): Handle TDF_CHAIN. (dump_generic_node): Handle BLOCK. Do not abort with incomplete SWITCH_EXPRs. Do not dump body of an OpenMP directive if TDF_SLIM is given. <case OMP_PARALLEL, OMP_FOR, OMP_SECTIONS>: Don't print space after directive name. <OMP_FOR>: Handle printing OMP_FOR_PRE_BODY. Handle OMP_MASTER and OMP_ORDERED. Handle printing of OMP_BODY just in one place, goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY. Don't handle clause nodes here. Update omp statements to use dump_omp_clauses. Handle OMP_SINGLE, OMP_SECTIONS, OMP_SECTION, OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE, OMP_ATOMIC, OMP_CRITICAL, OMP_CLAUSE_NOWAIT, GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS, GOMP_FOR, GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE, GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN and GOMP_CLAUSE_COPYPRIVATE. Adjust output for GOMP_PARALLEL. (dump_omp_clauses): New. (print_declaration): Dump DECL_VALUE_EXPR. (op_symbol_1): Split out of op_symbol. (dumping_stmts): Remove. Update all users. * cgraph.c (cgraph_analyze_queue): New. (cgraph_add_new_function): New. * cgraph.h (cgraph_analyze_queue): Declare. (cgraph_add_new_function): Declare. (cgraph_lower_function): Remove. * tree.c (walk_tree): Walk OMP_CLAUSE_CHAIN of OMP_CLAUSE_* nodes. Use switch for all nodes, handle most of IS_EXPR_CODE_CLASS and TYPE_P nodes in its default clause. (empty_body_p): New. (tree_range_check_failed): New. (build5_stat): New. * tree.h (OMP_CLAUSE_REDUCTION_INIT, OMP_CLAUSE_REDUCTION_MERGE, OMP_CLAUSE_REDUCTION_PLACEHOLDER, OMP_CLAUSE_PRIVATE_DEBUG, OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE, OMP_FOR_PRE_BODY, OMP_MASTER_BODY, OMP_ORDERED_BODY OMP_BODY, OMP_CLAUSES, OMP_CLAUSE_DECL, OMP_CLAUSE_DEFAULT_KIND, OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL, OMP_CLAUSE_NUM_THREADS_EXPR, OMP_CLAUSE_IF_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_EXPR, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE. OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC, OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC, OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC, OMP_CLAUSE_REDUCTION_CODE OMP_SINGLE_CLAUSES, OMP_SINGLE_BODY, OMP_CLAUSE_SCHEDULE_CHUNK_SIZE, OMP_SECTION_BODY, OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New. (TREE_RANGE_CHECK): New. (empty_body_p): Declare. (enum omp_clause_default_kind): New. (build_string_literal): Declare. (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New. (build5_stat, build5): Declare. * tree-pass.h (TDF_CHAIN): Define. * tree-pass.h (PROP_gimple_lomp): Define. (pass_lower_omp): Declare. * diagnostic.h (debug_tree_chain): Declare. * builtins.c (get_builtin_sync_mode): Use 0 as last argument to mode_for_size. (expand_builtin): Handle sync BUILT_IN_*_16 builtins. * builtins.c (build_string_literal): Make extern. * gcc.c (include_spec_function): New. (static_spec_functions): Add it. (main): Move load of libgomp.spec ... (LINK_COMMAND_SPEC): ... here. (link_gomp_spec): New. (static_specs): Include it. (LINK_COMMAND_SPEC): Add link_gomp. (GOMP_SELF_SPECS): New. (driver_self_specs): Include it. (switch_matches): Don't mark inline. (main): Load libgomp.spec. * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_SECTIONS, OMP_SECTION, and OMP_SINGLE, OMP_FOR and OMP_PARALLEL. * tree-gimple.h (enum omp_parallel): Declare. (determine_parallel_type): Declare. (omp_firstprivatize_variable): Declare. (omp_reduction_init): Declare. (diagnose_omp_structured_block_errors): Declare. (struct walk_stmt_info): Add want_return_expr. (struct walk_stmt_info): Add want_bind_expr, want_locations. (find_omp_clause): Declare. (insert_field_into_struct): Declare. (struct walk_stmt_info): Move from tree-nested.c (walk_stmts): Declare. * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP to 200505. * cgraphunit.c (cgraph_lower_function): Make static. (cgraph_finalize_pending_functions): New. (cgraph_finalize_function): Call it. (cgraph_finalize_compilation_unit): Likewise. * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16, BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add. (BT_FN_UINT_UINT): New. (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7, DEF_FUNCTION_TYPE_VAR_4): Document. (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT, BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT, BT_FN_VOID_OMPFN_PTR_UINT_UINT, BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG, BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New. * builtins.def: Update DEF_BUILTIN comment to include COND argument. Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins into separate files. (DEF_GOMP_BUILTIN): New. (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER, BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END, BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END, BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START, BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START, BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT, BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START, BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START, BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START, BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT, BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END, BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END, BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT, BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END, BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START, BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New. * sync-builtins.def: New file, moved from builtins.def. * omp-builtins.def: New file, moved from builtins.def. * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine. * gimple-low.c (lower_function_body): Clear data. (lower_stmt): Do not handle COMPOUND_EXPR. Remove call to print_node_brief. * c-tree.h (c_finish_omp_clauses): New prototype. (C_DECL_THREADPRIVATE_P): Define. (lookup_name_no_remap, c_omp_remap_private): Remove (c_begin_omp_parallel, c_finish_omp_parallel): Update. (check_for_loop_decls): Update decl. (lookup_name_no_remap, c_omp_remap_private): Declare. (build_indirect_ref, build_modify_expr, pushdecl, pushdecl_top_level): Move to c-common.h. * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp before the switch, but just in the 2 places that need it. * c-decl.c (diagnose_mismatched_decls): Do not check for mismatched thread-local attributes when OLDDECL is marked threadprivate and NEWDECL has no thread-local attributes. (merge_decls): Merge C_DECL_THREADPRIVATE_P. (c_gimple_diagnostics_recursively): Rename from c_warn_unused_result_recursively. Invoke diagnose_omp_structured_block_errors. (check_for_loop_decls): Return a singular decl found. * langhooks.c (lhd_omp_predetermined_sharing): Return OMP_CLAUSE_DEFAULT_SHARED for DECL_ARTIFICIAL decls. (lhd_omp_firstprivatize_type_sizes): New. (lhd_omp_assignment): New. (lhd_omp_predetermined_sharing): New. * langhooks.h (struct gimplify_omp_ctx): Forward declare. (struct lang_hooks_for_types): Add omp_firstprivatize_type_sizes, omp_privatize_by_reference, omp_predetermined_sharing, omp_disregard_value_expr, omp_private_debug_clause, omp_clause_default_ctor, omp_clause_copy_ctor, omp_clause_assign_op, omp_clause_dtor. (c_finish_omp_clauses): New. (c_finish_bc_stmt): Diagnose break within omp for. (c_begin_omp_parallel, c_finish_omp_parallel): New. (build_unary_op): Return error_mark after reporting a readonly_error. (build_modify_expr): Likewise. * gimplify.c: Include optabs.h and pointer-set.h. (enum gimplify_omp_var_data): Declare. (struct gimplify_omp_ctx): Declare. (struct gimplify_ctx): Add fields prev_context, combined_pre_p and combined_ctxp. (gimplify_ctxp, gimplify_omp_ctxp): New local variables. (push_gimplify_context, pop_gimplify_context): Allow nesting. (splay_tree_compare_decl_uid): New. (new_omp_context): New. (delete_omp_context): New. (gimple_add_tmp_var): Call omp_add_variable. (gimplify_bind_expr): Likewise. (gimplify_var_or_parm_decl): If omp_notice_variable returned true, disregard DECL_VALUE_EXPR on the decl if any. (gimplify_expr_in_ctx): New. (omp_firstprivatize_variable, omp_firstprivatize_type_sizes omp_add_variable, omp_notice_variable, omp_is_private gimplify_scan_omp_clauses, gimplify_adjust_omp_clauses_1 gimplify_adjust_omp_clauses, gimplify_omp_parallel gimplify_omp_for, gimplify_omp_workshare, goa_lhs_expr_p gimplify_omp_atomic_fetch_op, goa_stabilize_expr gimplify_omp_atomic_pipeline, gimplify_omp_atomic_mutex gimplify_omp_atomic): New. (gimplify_expr): Handle OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL and OMP_ATOMIC. (gimplify_body): Verify gimplify_ctxp is empty after gimplification. * c-pragma.h (enum pragma_kind): Add PRAGMA_OMP_ATOMIC, PRAGMA_OMP_BARRIER, PRAGMA_OMP_CRITICAL, PRAGMA_OMP_FLUSH, PRAGMA_OMP_FOR, PRAGMA_OMP_MASTER, PRAGMA_OMP_ORDERED, PRAGMA_OMP_PARALLEL, PRAGMA_OMP_PARALLEL_FOR, PRAGMA_OMP_PARALLEL_SECTIONS, PRAGMA_OMP_SECTION, PRAGMA_OMP_SECTIONS, PRAGMA_OMP_SINGLE, PRAGMA_OMP_THREADPRIVATE. * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SINGLE, OMP_SECTION, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_ATOMIC, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE, OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE, OMP_CLAUSE_IF, OMP_CLAUSE_NUM_THREADS, OMP_CLAUSE_SCHEDULE, OMP_CLAUSE_NOWAIT, OMP_CLAUSE_ORDERED, OMP_CLAUSE_DEFAULT): Define. * print-tree.c (print_node): Dump DECL_VALUE_EXPR. * tree-ssa-dce.c (find_control_dependence): Do not assume that ENTRY_BLOCK_PTR->next_bb == single_succ (ENTRY_BLOCK_PTR). * tree-nested.c (convert_call_expr): Call walk_body on OMP_BODY for OpenMP directives. (struct nesting_info): Add field_map, suppress_expansion, debug_var_chain. (create_nesting_tree): Initialize them. (lookup_field_for_decl): Use field_map. (get_nonlocal_debug_decl, get_local_debug_decl): New. (convert_local_omp_clauses): New. (finalize_nesting_tree_1): Add debug_var_chain to toplevel block. (walk_body): Split out of walk_function. (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New. (convert_nonlocal_reference): Handle omp statements. (convert_local_reference): Likewise. (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1. (unnest_nesting_tree): New. (lower_nested_functions): Call it. (insert_field_into_struct): Make extern. (struct walk_stmt_info): Move to tree-gimple.h. (walk_stmts): Make extern. * omp-builtins.def: New file. * tree-iterator.c (expr_only): Clarify comment. * c-common.h (pushdecl_top_level, pushdecl, build_modify_expr, build_indirect_ref, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_for, c_split_parallel_clauses, omp_clause_default_kind, c_omp_sharing_predetermined, c_omp_remap_decl): Declare. * Makefile.in (BUILTINS_DEF): Add omp-builtins.def. (OBJS-common): Add omp-low.o. (c-omp.o, omp-low.o): Add. (gimplify.o): Add dependency on $(OPTABS_H). (GTFILES): Add omp-low.c. (gt-stringpool.h): Add. * tree-cfg.c (set_bb_for_stmt): Do not update the block-to-labels map if we are currently expanding to RTL. (tree_node_can_be_shared): Remove unnecessary CONSTANT_CLASS_P checks. Handle IDENTIFIER_NODE. (tree_verify_flow_info): Do not ICE when emitting error messages about invalid labels. (dump_function_to_file): Reset CFUN before emitting the body of the function. (debug_function): New. * passes.c (init_optimization_passes): Schedule pass_lower_omp. * langhooks-def.h (lhd_omp_predetermined_sharing, lhd_omp_assignment, lhd_omp_firstprivatize_type_sizes): Declare. (LANG_HOOKS_OMP_FIRSTPRIVATIZE_TYPE_SIZES): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Use it. (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE, LANG_HOOKS_OMP_PREDETERMINED_SHARING, LANG_HOOKS_OMP_DISREGARD_VALUE_EXPR, LANG_HOOKS_OMP_PRIVATE_DEBUG_CLAUSE, LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR, LANG_HOOKS_OMP_CLAUSE_COPY_CTOR, LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP, LANG_HOOKS_OMP_CLAUSE_DTOR): Define. (LANG_HOOK_DECLS): Use them. 2006-01-18 Dmitry Kurochkin <dmitry.kurochkin@gmail.com> Richard Henderson <rth@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> * c-parser.c (pragma_omp_clause): Define. (c_parser_declaration_or_fndef): Document OpenMP syntax. (c_parser_compound_statement): Likewise. (c_parser_statement): Likewise. (c_parser_pragma): Handle omp pragmas. (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK, OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): Define. (c_parser_omp_clause_name, check_no_duplicate_clause, c_parser_omp_variable_list, c_parser_omp_var_list_parens, c_parser_omp_clause_copyin, c_parser_omp_clause_copyprivate, c_parser_omp_clause_default, c_parser_omp_clause_firstprivate, c_parser_omp_clause_if, c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait, c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered, c_parser_omp_clause_private, c_parser_omp_clause_reduction, c_parser_omp_clause_schedule, c_parser_omp_clause_shared, c_parser_omp_all_clauses, c_parser_omp_structured_block, c_parser_omp_atomic, c_parser_omp_barrier, c_parser_omp_critical, c_parser_omp_flush, c_parser_omp_for_loop, c_parser_omp_for, c_parser_omp_master, c_parser_omp_ordered, c_parser_omp_sections_scope, c_parser_omp_sections, c_parser_omp_parallel, c_parser_omp_single, c_parser_omp_construct, c_parser_omp_threadprivate): New. * c-pragma.c (init_pragma): Do omp pragma registration here. * c.opt (fopenmp): New flag. 2006-01-18 Eric Christopher <echristo@apple.com> * gcc.c (GOMP_SELF_SPECS): Bracket in #ifndef/#endif. * config/darwin.h (GOMP_SELF_SPECS): Define. testsuite/ 2006-01-18 Richard Henderson <rth@redhat.com> Aldy Hernandez <aldyh@redhat.com> Jakub Jelinek <jakub@redhat.com> Diego Novillo <dnovillo@redhat.com> Uros Bizjak <uros@kss-loka.si> * testsuite/gcc.dg/gomp: New directory. From-SVN: r109902
2006-01-18 20:21:25 +01:00
tree_lowering_passes (node->decl);
node->lowered = true;
}
/* DECL has been parsed. Take it, queue it, compile it at the whim of the
logic in effect. If NESTED is true, then our caller cannot stand to have
the garbage collector run at the moment. We would need to either create
a new GC context, or just not compile right now. */
void
cgraph_finalize_function (tree decl, bool nested)
{
struct cgraph_node *node = cgraph_node (decl);
if (node->local.finalized)
cgraph_reset_node (node);
Patch by Tomas Bily <tbily@suse.cz> Patch by Tomas Bily <tbily@suse.cz> * cgraphunit.c (cgraph_finalize_function): Updating of pid * tree-profile.c: (tree_init_ic_make_global_vars): New function (tree_init_edge_profiler): call of tree_init_ic_make_global_vars (tree_gen_ic_profiler): New function (tree_gen_ic_func_profiler): New function (tree_profiling): Added calling of tree_gen_ic_func_profiler (tree_profile_hooks): Added hook for indirec/virtual calls * value-prof.c (tree_find_values_to_profile): New case for indirect calls (tree_values_to_profile): Call for determining indirect/virtual counters (tree_indirect_call_to_profile): New function (tree_ic_transform): New function (tree_ic): New function (find_func_by_pid): New function (init_pid_map): New function (tree_value_profile_transformations): Added check for indirect/virtual call transformation * value-prof.h (enum hist_type): New counter type for indirect/virtual calls (profile_hooks): Added new hook for profiling indirect/virtual calls * profile.c (instrument_values): New case for indirect/virtual call added * gcov-io.h (GCOV_LAST_VALUE_COUNTER): Changed to 6 (GCOV_COUNTER_V_INDIR): New counter type (GCOV_COUNTER_NAMES): New name of counter "indirect" added (GCOV_MERGE_FUNCTIONS): New merge function for indirect/virtual call added * cgraph.c: Definition of cgraph_max_pid (cgraph_create_node): Default init of pid attribute * cgraph.h: Declaration of cgraph_max_pid (struct cgraph_node): Added pid attribute * libgcov.c (__gcov_indirect_call_profiler): New function (__gcov_one_value_profiler_body): New function (__gcov_one_value_profiler): Body was moved to __gcov_one_value_profiler_body and calls it gcc.dg/tree-prof/indir-call-prof.c: New. g++.dg/dg.exp: Add tree-prof subdirectory. g++.dg/tree-prof/indir-call-prof.C: New. g++.dg/tree-prof/tree-prof.exp: New. From-SVN: r120975
2007-01-19 19:34:02 +01:00
node->pid = cgraph_max_pid ++;
notice_global_symbol (decl);
node->local.finalized = true;
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
node->lowered = DECL_STRUCT_FUNCTION (decl)->cfg != NULL;
node->finalized_by_frontend = true;
record_cdtor_fn (node->decl);
if (cgraph_decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
/* Since we reclaim unreachable nodes at the end of every language
level unit, we need to be conservative about possible entry points
there. */
if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)))
cgraph_mark_reachable_node (node);
/* If we've not yet emitted decl, tell the debug info about it. */
if (!TREE_ASM_WRITTEN (decl))
(*debug_hooks->deferred_inline_function) (decl);
/* Possibly warn about unused parameters. */
if (warn_unused_parameter)
do_warn_unused_parameter (decl);
cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. (build_cgraph_edges): Likewise. * cgraph.c (cgraph_node): Do not update assembler hash. (cgraph_remove_node): Drop non-unit-at-a-time code. * tree-pass.h (pass_O0_always_inline): Remove. * ipa-reference.c (gate_reference): Remove unit-at-a-time check. * toplev.c (process_options): Flag unit-at-a-time does not imply no section anchors. * cgraphunit.c: Update comments. (decide_is_function_needed): Drop non-unit-at-a-time mode. (cgraph_assemble_pending_functions): Remove. (cgraph_reset_node): Drop non-unit-at-a-time code. (cgraph_finalize_function): Likewise. (cgraph_analyze_function): Likewise. (cgraph_finalize_compilation_unit): Likewise. (cgraph_expand_function): Likewise. (cgraph_optimize): Likesise. (save_inline_function_body): Likewise. * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check. * tree-ssa-alias.c (maybe_be_aliased): Likewise. * ipa-inline.c: Update comments. (enum inlining_mode): remove INLINE_SPEED. (cgraph_clone_inlined_nodes): Drop unit-at-a-time check. (cgraph_mark_inline_edge): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. (cgraph_gate_inlining): Remove. (cgraph_early_inlining): Remove flag_unit_at_a_time checks. (cgraph_gate_early_inlining): Likewise. (gate_inline_passes): Remove. (pass_inline_parameters, pass_ipa_inline): Remove gates. (cgraph_gate_O0_always_inline, cgraph_O0_always_inline, pass_O0_always_inline): Remove. * c-pch.c (c_pch_matching): Remove -funit-at-a-time. * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check. * opts.c (no_unit_at_a_time_default): Remove. (decode_options): Remove flag_unit_at_a_time reset and warning. * opts.h (no_unit_at_a_time_default): Remove. * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword early in GNU dialect. (merge_decls): Update comment; drop unit-at-a-time check. (finish_decl): Likewise. (grok_declaration): Remove flag_inline_trees code. (finish_functions): Return on function returning non-void on all statics. * ipa-tye-escape.c (gate_type_escape_vars): Remove. * cfgexpand.c (expand_one_static_var): Remove. (expand_one_var): Remove expand_one_static_var call. (expand_used_vars_for_block): Remove flag_unit_a_time check. * c-opts.c (c_common_post_options): Remove flag_inline_trees code and flag_unit_at_a-time compatibility checks. * varasm.c (assemble_alias): Remove flag_unit_at_a_time check. * tree-inline.c (flag_inline_trees): Remove. (inlinable_function_p): Don't check it. (expand_call_inline): Remove non-unit-at-a-time code. * tree-inline.h (flag_inline_trees): Remove. * tree-optimize.c (execute_early_local_optimizations): Remove unit-at-a-time checks. (tree_rest_of_compilation): Likewise. * combine.c (setup_incoming_promotions): Likewise. * tree-profile.c (tree_gen_ic_func_profiler): Likewise. * tree-ssa-structalias.c (delete_points_to_sets): Likewise. * passes.c (pass_inline_parameters): Update comments; remove O0_alwaysinline pass. (execute_one_ipa_transform_pass): Do not reset in_gimple_form. (execute_one_pass): Likewise. * i386.c (ix86_function_regparm): Remove unit-at-a-time check. (ix86_function_sseregparm): Likewise. * arm.c (arm_function_in_section_p): Likewise. * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise. * varpool.c: Update comments. (decide_is_variable_needed): Remove unit-at-a-time checks. (varpool_finalize_decl): Likewise. * ada/utils.c (end_subprog_body): Remove inline trees check. * ada/misc.c (gnat_post_options): Do not set flag_inline_trees. * fortran/options.c (gfc_post_options): Remove flag_unline_trees code. * gcc.dg/winline-4.c: Remove. * gcc.dg/pch/valid-3.hs: Remove. * gcc.dg/pch/valid-3.c: Remove. * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning * g++.old-deja/g++.jason/report.C: Likewise. * testsuite/g++.dg/warn/pr23075.C: We get returning void warning instead of control flow warning. * cp/decl.c (duplicate_decls): Update comment and unit-at-a-time. (grogfndecl): Drop flag_inline_trees code. * cp/pt.c (instantiate_decl): Drop flag_iline_trees code. * cp/lex.c (cxx_init): Do not set unit-at-a-time. * java/decl.c: Include cgraph.h (end_java_method): Remove non-unit-at-a-time code. (java_mark_decl_local): Likewise; sanity check that we don't touch finalized nodes. From-SVN: r138140
2008-07-25 15:11:32 +02:00
if (!nested)
ggc_collect ();
}
/* C99 extern inline keywords allow changing of declaration after function
has been finalized. We need to re-decide if we want to mark the function as
needed then. */
void
cgraph_mark_if_needed (tree decl)
{
struct cgraph_node *node = cgraph_node (decl);
if (node->local.finalized && cgraph_decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
}
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
/* Return TRUE if NODE2 is equivalent to NODE or its clone. */
static bool
clone_of_p (struct cgraph_node *node, struct cgraph_node *node2)
{
while (node != node2 && node2)
node2 = node2->clone_of;
return node2 != NULL;
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
/* Verify cgraph nodes of given cgraph node. */
void
verify_cgraph_node (struct cgraph_node *node)
{
struct cgraph_edge *e;
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
struct function *this_cfun = DECL_STRUCT_FUNCTION (node->decl);
struct function *saved_cfun = cfun;
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
basic_block this_block;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple_stmt_iterator gsi;
bool error_found = false;
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
if (errorcount || sorrycount)
return;
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
timevar_push (TV_CGRAPH_VERIFY);
/* debug_generic_stmt needs correct cfun */
set_cfun (this_cfun);
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
for (e = node->callees; e; e = e->next_callee)
if (e->aux)
{
error ("aux field set for edge %s->%s",
attribs.c (decl_attributes): Use %qE for identifiers in diagnostics. * attribs.c (decl_attributes): Use %qE for identifiers in diagnostics. * cgraphunit.c (verify_cgraph_node): Translate function names to locale character set in diagnostics. * coverage.c (get_coverage_counts): Use %qE for identifiers in diagnostics. * doc/invoke.texi (-finstrument-functions-exclude-function-list): Document that functions are named in UTF-8. * expr.c (expand_expr_real_1): Translate function names to locale character set in diagnostics. * gimplify.c (omp_notice_variable, omp_is_private, gimplify_scan_omp_clauses): Use %qE for identifiers in diagnostics. * langhooks.c (lhd_print_error_function): Translate function names to locale character set. * langhooks.h (decl_printable_name): Document that return value is in internal character set. * stmt.c: Include pretty-print.h (tree_conflicts_with_clobbers_p): Use %qE for identifiers in diagnostics. (resolve_operand_name_1): Translate named operand name to locale character set. * stor-layout.c (finalize_record_size): Use %qE for identifiers in diagnostics. * toplev.c (announce_function): Translate function names to locale character set. (warn_deprecated_use): Use %qE for identifiers in diagnostics. (default_tree_printer): Use pp_identifier or translate identifiers to locale character set. Mark "<anonymous>" for translation. * tree-mudflap.c (mx_register_decls, mudflap_finish_file): Use %qE for identifiers in diagnostics. * tree.c (handle_dll_attribute): Use %qE for identifiers in diagnostics. * varasm.c (output_constructor): Use %qE for identifiers in diagnostics. testsuite: * gcc.dg/ucnid-11.c, gcc.dg/ucnid-12.c, gcc.dg/ucnid-13.c: New tests. From-SVN: r147111
2009-05-05 01:44:36 +02:00
identifier_to_locale (cgraph_node_name (e->caller)),
identifier_to_locale (cgraph_node_name (e->callee)));
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
error_found = true;
}
if (node->count < 0)
{
error ("Execution count is negative");
error_found = true;
}
lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has no address taken. * 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. From-SVN: r152520
2009-10-07 11:01:16 +02:00
if (node->global.inlined_to && node->local.externally_visible)
{
error ("Externally visible inline clone");
error_found = true;
}
if (node->global.inlined_to && node->address_taken)
{
error ("Inline clone with address taken");
error_found = true;
}
if (node->global.inlined_to && node->needed)
{
error ("Inline clone is needed");
error_found = true;
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
for (e = node->indirect_calls; e; e = e->next_callee)
{
if (e->aux)
{
error ("aux field set for indirect edge from %s",
identifier_to_locale (cgraph_node_name (e->caller)));
error_found = true;
}
if (!e->indirect_unknown_callee
|| !e->indirect_info)
{
error ("An indirect edge from %s is not marked as indirect or has "
"associated indirect_info, the corresponding statement is: ",
identifier_to_locale (cgraph_node_name (e->caller)));
debug_gimple_stmt (e->call_stmt);
error_found = true;
}
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
for (e = node->callers; e; e = e->next_caller)
{
if (e->count < 0)
{
error ("caller edge count is negative");
error_found = true;
}
if (e->frequency < 0)
{
error ("caller edge frequency is negative");
error_found = true;
}
if (e->frequency > CGRAPH_FREQ_MAX)
{
error ("caller edge frequency is too large");
error_found = true;
}
if (gimple_has_body_p (e->caller->decl)
&& !e->caller->global.inlined_to
&& (e->frequency
!= compute_call_stmt_bb_frequency (e->caller->decl,
gimple_bb (e->call_stmt))))
{
error ("caller edge frequency %i does not match BB freqency %i",
e->frequency,
compute_call_stmt_bb_frequency (e->caller->decl,
gimple_bb (e->call_stmt)));
error_found = true;
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
if (!e->inline_failed)
{
if (node->global.inlined_to
!= (e->caller->global.inlined_to
? e->caller->global.inlined_to : e->caller))
{
error ("inlined_to pointer is wrong");
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
error_found = true;
}
if (node->callers->next_caller)
{
error ("multiple inline callers");
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
error_found = true;
}
}
else
if (node->global.inlined_to)
{
error ("inlined_to pointer set for noninline callers");
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
error_found = true;
}
}
if (!node->callers && node->global.inlined_to)
{
error ("inlined_to pointer is set but no predecessors found");
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
error_found = true;
}
if (node->global.inlined_to == node)
{
error ("inlined_to pointer refers to itself");
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
error_found = true;
}
if (!cgraph_node (node->decl))
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
{
error ("node not found in cgraph_hash");
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
error_found = true;
}
2006-05-19 00:16:23 +02:00
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
if (node->clone_of)
{
struct cgraph_node *n;
for (n = node->clone_of->clones; n; n = n->next_sibling_clone)
if (n == node)
break;
if (!n)
{
error ("node has wrong clone_of");
error_found = true;
}
}
if (node->clones)
{
struct cgraph_node *n;
for (n = node->clones; n; n = n->next_sibling_clone)
if (n->clone_of != node)
break;
if (n)
{
error ("node has wrong clone list");
error_found = true;
}
}
if ((node->prev_sibling_clone || node->next_sibling_clone) && !node->clone_of)
{
error ("node is in clone list but it is not clone");
error_found = true;
}
if (!node->prev_sibling_clone && node->clone_of && node->clone_of->clones != node)
{
error ("node has wrong prev_clone pointer");
error_found = true;
}
if (node->prev_sibling_clone && node->prev_sibling_clone->next_sibling_clone != node)
{
error ("double linked list of clones corrupted");
error_found = true;
}
if (node->same_comdat_group)
{
struct cgraph_node *n = node->same_comdat_group;
if (!DECL_ONE_ONLY (node->decl))
{
error ("non-DECL_ONE_ONLY node in a same_comdat_group list");
error_found = true;
}
if (n == node)
{
error ("node is alone in a comdat group");
error_found = true;
}
do
{
if (!n->same_comdat_group)
{
error ("same_comdat_group is not a circular list");
error_found = true;
break;
}
n = n->same_comdat_group;
}
while (n != node);
}
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
if (node->analyzed && gimple_has_body_p (node->decl)
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
&& !TREE_ASM_WRITTEN (node->decl)
&& (!DECL_EXTERNAL (node->decl) || node->global.inlined_to)
&& !flag_wpa)
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
{
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
if (this_cfun->cfg)
{
/* The nodes we're interested in are never shared, so walk
the tree ignoring duplicates. */
struct pointer_set_t *visited_nodes = pointer_set_create ();
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
/* Reach the trees by walking over the CFG, and note the
enclosing basic-blocks in the call edges. */
FOR_EACH_BB_FN (this_block, this_cfun)
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
for (gsi = gsi_start_bb (this_block);
!gsi_end_p (gsi);
gsi_next (&gsi))
{
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple stmt = gsi_stmt (gsi);
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
if (is_gimple_call (stmt))
{
struct cgraph_edge *e = cgraph_edge (node, stmt);
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
tree decl = gimple_call_fndecl (stmt);
if (e)
{
if (e->aux)
{
error ("shared call_stmt:");
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
debug_gimple_stmt (stmt);
error_found = true;
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
if (!e->indirect_unknown_callee)
{
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
if (e->callee->same_body_alias)
{
error ("edge points to same body alias:");
debug_tree (e->callee->decl);
error_found = true;
}
else if (!node->global.inlined_to
&& !e->callee->global.inlined_to
&& decl
&& !clone_of_p (cgraph_node (decl),
e->callee))
{
error ("edge points to wrong declaration:");
debug_tree (e->callee->decl);
fprintf (stderr," Instead of:");
debug_tree (decl);
error_found = true;
}
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
else if (decl)
{
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
error ("an indirect edge with unknown callee "
"corresponding to a call_stmt with "
"a known declaration:");
error_found = true;
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
debug_gimple_stmt (e->call_stmt);
}
e->aux = (void *)1;
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
else if (decl)
{
error ("missing callgraph edge for call stmt:");
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
debug_gimple_stmt (stmt);
error_found = true;
}
}
}
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
pointer_set_destroy (visited_nodes);
}
else
/* No CFG available?! */
gcc_unreachable ();
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
for (e = node->callees; e; e = e->next_callee)
{
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
if (!e->aux)
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
{
error ("edge %s->%s has no corresponding call_stmt",
attribs.c (decl_attributes): Use %qE for identifiers in diagnostics. * attribs.c (decl_attributes): Use %qE for identifiers in diagnostics. * cgraphunit.c (verify_cgraph_node): Translate function names to locale character set in diagnostics. * coverage.c (get_coverage_counts): Use %qE for identifiers in diagnostics. * doc/invoke.texi (-finstrument-functions-exclude-function-list): Document that functions are named in UTF-8. * expr.c (expand_expr_real_1): Translate function names to locale character set in diagnostics. * gimplify.c (omp_notice_variable, omp_is_private, gimplify_scan_omp_clauses): Use %qE for identifiers in diagnostics. * langhooks.c (lhd_print_error_function): Translate function names to locale character set. * langhooks.h (decl_printable_name): Document that return value is in internal character set. * stmt.c: Include pretty-print.h (tree_conflicts_with_clobbers_p): Use %qE for identifiers in diagnostics. (resolve_operand_name_1): Translate named operand name to locale character set. * stor-layout.c (finalize_record_size): Use %qE for identifiers in diagnostics. * toplev.c (announce_function): Translate function names to locale character set. (warn_deprecated_use): Use %qE for identifiers in diagnostics. (default_tree_printer): Use pp_identifier or translate identifiers to locale character set. Mark "<anonymous>" for translation. * tree-mudflap.c (mx_register_decls, mudflap_finish_file): Use %qE for identifiers in diagnostics. * tree.c (handle_dll_attribute): Use %qE for identifiers in diagnostics. * varasm.c (output_constructor): Use %qE for identifiers in diagnostics. testsuite: * gcc.dg/ucnid-11.c, gcc.dg/ucnid-12.c, gcc.dg/ucnid-13.c: New tests. From-SVN: r147111
2009-05-05 01:44:36 +02:00
identifier_to_locale (cgraph_node_name (e->caller)),
identifier_to_locale (cgraph_node_name (e->callee)));
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
debug_gimple_stmt (e->call_stmt);
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
error_found = true;
}
e->aux = 0;
}
cgraph.h (struct cgraph_node): New field indirect_calls. 2010-04-28 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_node): New field indirect_calls. (struct cgraph_indirect_call_info): New type. (struct cgraph_edge): Removed field indirect_call. New fields indirect_info, indirect_inlining_edge and indirect_unknown_callee. (cgraph_create_indirect_edge): Declare. (cgraph_make_edge_direct): Likewise. (enum LTO_cgraph_tags): New item LTO_cgraph_indirect_edge. * ipa-prop.h (struct ipa_param_call_note): Removed. (struct ipa_node_params): Removed field param_calls. (ipa_create_all_structures_for_iinln): Declare. * cgraph.c: Described indirect edges and uids in initial comment. (cgraph_add_edge_to_call_site_hash): New function. (cgraph_edge): Search also among the indirect edges, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (cgraph_set_call_stmt): Possibly turn an indirect edge into a direct one, use cgraph_add_edge_to_call_site_hash to add edges to the call site hash. (initialize_inline_failed): Assign a reason to indirect edges. (cgraph_create_edge_1): New function. (cgraph_create_edge): Moved some functionality to cgraph_create_edge_1. (cgraph_create_indirect_edge): New function. (cgraph_edge_remove_callee): Add an assert checking for non-indirectness. (cgraph_edge_remove_caller): Special-case indirect edges. (cgraph_remove_edge): Likewise. (cgraph_set_edge_callee): New function. (cgraph_redirect_edge_callee): Use cgraph_set_edge_callee. (cgraph_make_edge_direct): New function. (cgraph_update_edges_for_call_stmt_node): Do nothing only when also the declaration of the call statement matches. (cgraph_node_remove_callees): Special-case indirect edges. (cgraph_clone_edge): Likewise. (cgraph_clone_node): Clone also the indirect edges. (dump_cgraph_node): Dump indirect_inlining_edge flag instead of indirect_call, dump count of indirect_calls edges. * ipa-prop.c (iinlining_processed_edges): New variable. (ipa_note_param_call): Create indirect edges instead of creating notes. New parameter node. (ipa_analyze_call_uses): New parameter node, pass it on to ipa_note_param_call. (ipa_analyze_stmt_uses): Likewise. (ipa_analyze_params_uses): Pass node to ipa_analyze_stmt_uses. (print_edge_addition_message): Work on edges rather than on notes. (update_call_notes_after_inlining): Likewise, renamed to update_indirect_edges_after_inlining. (ipa_create_all_structures_for_iinln): New function. (ipa_free_node_params_substructures): Do not free notes. (ipa_edge_duplication_hook): Propagate bits within iinlining_processed_edges bitmap. (ipa_node_duplication_hook): Do not duplicate notes. (free_all_ipa_structures_after_ipa_cp): Renamed to ipa_free_all_structures_after_ipa_cp. (free_all_ipa_structures_after_iinln): Renamed to ipa_free_all_structures_after_iinln.g (ipa_write_param_call_note): Removed. (ipa_read_param_call_note): Removed. (ipa_write_indirect_edge_info): New function. (ipa_read_indirect_edge_info): Likewise. (ipa_write_node_info): Do not stream notes, do stream information in indirect edges. (ipa_read_node_info): Likewise. (lto_ipa_fixup_call_notes): Removed. * ipa-cp.c (pass_ipa_cp): Set stmt_fixup to NULL. * ipa-inline.c (pass_ipa_inline): Likewise. * cgraphunit.c (verify_cgraph_node): Check also indirect edges. * cif-code.def (INDIRECT_UNKNOWN_CALL): New reason. * tree-inline.c (copy_bb): Removed an unnecessary double check for is_gimple_call. * tree-inline.c (get_indirect_callee_fndecl): Do not consider indirect edges. * lto-cgraph.c (output_outgoing_cgraph_edges): New function. (output_cgraph): Stream also indirect edges. (lto_output_edge): Added capability to stream indirect edges. (input_edge): Likewise. (input_cgraph_1): Likewise. * testsuite/gcc.dg/lto/20091209-1_0.c: New testcase. From-SVN: r158827
2010-04-28 16:05:54 +02:00
for (e = node->indirect_calls; e; e = e->next_callee)
{
if (!e->aux)
{
error ("an indirect edge from %s has no corresponding call_stmt",
identifier_to_locale (cgraph_node_name (e->caller)));
debug_gimple_stmt (e->call_stmt);
error_found = true;
}
e->aux = 0;
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
}
if (error_found)
{
dump_cgraph_node (stderr, node);
internal_error ("verify_cgraph_node failed");
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
}
set_cfun (saved_cfun);
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
timevar_pop (TV_CGRAPH_VERIFY);
}
/* Verify whole cgraph structure. */
void
verify_cgraph (void)
{
struct cgraph_node *node;
if (sorrycount || errorcount)
return;
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
for (node = cgraph_nodes; node; node = node->next)
verify_cgraph_node (node);
}
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
/* Output all asm statements we have stored up to be output. */
static void
cgraph_output_pending_asms (void)
{
struct cgraph_asm_node *can;
if (errorcount || sorrycount)
return;
for (can = cgraph_asm_nodes; can; can = can->next)
assemble_asm (can->asm_str);
cgraph_asm_nodes = NULL;
}
/* Analyze the function scheduled to be output. */
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
static void
cgraph_analyze_function (struct cgraph_node *node)
{
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
tree save = current_function_decl;
tree decl = node->decl;
current_function_decl = decl;
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
push_cfun (DECL_STRUCT_FUNCTION (decl));
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
assign_assembler_name_if_neeeded (node->decl);
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
/* Make sure to gimplify bodies only once. During analyzing a
function we lower it, which will require gimplified nested
functions, so we can end up here with an already gimplified
body. */
if (!gimple_body (decl))
gimplify_function_tree (decl);
dump_function (TDI_generic, decl);
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
cgraph_lower_function (node);
node->analyzed = true;
cgraph.h (cgraph_node): Add 'lowered' state. * cgraph.h (cgraph_node): Add 'lowered' state. (cgraph_lower_function): Declare. * cgraphunit.c (cgraph_finalize_function): Initialize lowered flag. (cgraph_lower_function): New function. (cgraph_create_edges): Deal with lowered function bodies. (verify_cgraph_node): Likewise. (cgraph_analyze_function): Do lowering job. (cgraph_build_static_cdtor): Likewise. * function.h (struct function): Add saved_eh and saved_cfg. * integrate.c (copy_decl_for_inlining): Kill LABEL_DECL_UID field. * tree-cfg.c (fold_cond_expr_cond): Export. * tree-flow.h (fold_cond_expr_cond): Declare. * tree-inline.c: Include basic-block, ggc, tree-flow, except.h and pointer-set. (struct_inline_data): Kill fnd, first_inlined_fn, ret_label, in_target_cleanup_p, tree_pruner, tsi; add callee, caller and callee_cfun, block, eh_region, eh_region_offset. (inlining_p): New predicate. (remap_decl): Update for new inline_data; declare newly created inline vars in low gimple way. (copy_body_r): Update for new datastructure, simplify some of handling when we are in gimple; remap LABEL_DECLs for EH; copy TREE_BLOCK; deal with RESX_EXPRs. (copy_bb): New. (copy_edges_for_bb): Likewise. (remap_decl_1): New. (copy_cfg_body): New. (copy_generic_body): Rewrite to work on low gimple. (copy_body): Turn into simple wrapper around copy_cfg_body. (setup_one_parameter): Insert new statements into given basic block. (initialize_initialized_parameters): Likewise, reorganize way things are gimplified. (declare_return_variable): Update for new inline data datastructure. (inline_forbidden_p): Work on low gimple. (estimate_num_insns): Likewise. (expand_call_inline): Work on CFG. (push_cfun, pop_cfun): New functions. (cfun_stack): New stack. (add_lexical_block): New function. (gimple_expand_calls_inline): Work on basic block. (optimize_inline_calls): Likewise. (clone_body, save_body, unsave_ewpr_now): Update for new datastructures. (declare_inline_vars): Work on block instead of bind_expr. (inlining_p): New predicate. * tree-inline.h (push_cfun, pop_cfun): Declare. * tree-optimize.c: Include except.h (all_lowering_passes): New variable. (execute_fixup_cfg, pass_fixup_cfg): New pass. (init_tree_optimization_passes): Move some to all_lowering_passes. (tree_lowering_passes): New function. (tree_rest_of_compilation): Register cfg hooks; save/unsave eh. Co-Authored-By: Dale Johannesen <dalej@apple.com> Co-Authored-By: Jan Hubicka <jh@suse.cz> Co-Authored-By: Stuart Hastings <stuart@apple.com> From-SVN: r99840
2005-05-17 18:56:32 +02:00
pop_cfun ();
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
current_function_decl = save;
}
/* Look for externally_visible and used attributes and mark cgraph nodes
accordingly.
We cannot mark the nodes at the point the attributes are processed (in
handle_*_attribute) because the copy of the declarations available at that
point may not be canonical. For example, in:
void f();
void f() __attribute__((used));
the declaration we see in handle_used_attribute will be the second
declaration -- but the front end will subsequently merge that declaration
with the original declaration and discard the second declaration.
Furthermore, we can't mark these nodes in cgraph_finalize_function because:
void f() {}
void f() __attribute__((externally_visible));
is valid.
So, we walk the nodes at the end of the translation unit, applying the
attributes at that point. */
static void
process_function_and_variable_attributes (struct cgraph_node *first,
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
struct varpool_node *first_var)
{
struct cgraph_node *node;
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
struct varpool_node *vnode;
for (node = cgraph_nodes; node != first; node = node->next)
{
tree decl = node->decl;
if (DECL_PRESERVE_P (decl))
{
mark_decl_referenced (decl);
if (node->local.finalized)
cgraph_mark_needed_node (node);
}
if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl)))
{
if (! TREE_PUBLIC (node->decl))
warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wattributes,
"%<externally_visible%>"
" attribute have effect only on public objects");
lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has no address taken. * 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. From-SVN: r152520
2009-10-07 11:01:16 +02:00
else if (node->local.finalized)
cgraph_mark_needed_node (node);
}
}
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
for (vnode = varpool_nodes; vnode != first_var; vnode = vnode->next)
{
tree decl = vnode->decl;
if (DECL_PRESERVE_P (decl))
{
mark_decl_referenced (decl);
vnode->force_output = true;
if (vnode->finalized)
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
varpool_mark_needed_node (vnode);
}
if (lookup_attribute ("externally_visible", DECL_ATTRIBUTES (decl)))
{
if (! TREE_PUBLIC (vnode->decl))
warning_at (DECL_SOURCE_LOCATION (vnode->decl), OPT_Wattributes,
"%<externally_visible%>"
" attribute have effect only on public objects");
lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has no address taken. * 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. From-SVN: r152520
2009-10-07 11:01:16 +02:00
else if (vnode->finalized)
varpool_mark_needed_node (vnode);
}
}
}
/* Process CGRAPH_NODES_NEEDED queue, analyze each function (and transitively
each reachable functions) and build cgraph.
The function can be called multiple times after inserting new nodes
into beginning of queue. Just the new part of queue is re-scanned then. */
static void
cgraph_analyze_functions (void)
{
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
/* Keep track of already processed nodes when called multiple times for
intermodule optimization. */
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
static struct cgraph_node *first_analyzed;
struct cgraph_node *first_processed = first_analyzed;
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
static struct varpool_node *first_analyzed_var;
struct cgraph_node *node, *next;
process_function_and_variable_attributes (first_processed,
first_analyzed_var);
first_processed = cgraph_nodes;
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
first_analyzed_var = varpool_nodes;
varpool_analyze_pending_decls ();
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Initial entry points:");
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
for (node = cgraph_nodes; node != first_analyzed; node = node->next)
if (node->needed)
fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
fprintf (cgraph_dump_file, "\n");
}
cgraph_process_new_functions ();
/* Propagate reachability flag and lower representation of all reachable
functions. In the future, lowering will introduce new functions and
new entry points on the way (by template instantiation and virtual
method table generation for instance). */
while (cgraph_nodes_queue)
{
struct cgraph_edge *edge;
tree decl = cgraph_nodes_queue->decl;
node = cgraph_nodes_queue;
cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
node->next_needed = NULL;
/* ??? It is possible to create extern inline function and later using
weak alias attribute to kill its body. See
gcc.c-torture/compile/20011119-1.c */
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
if (!DECL_STRUCT_FUNCTION (decl))
{
cgraph_reset_node (node);
continue;
}
if (!node->analyzed)
cgraph_analyze_function (node);
for (edge = node->callees; edge; edge = edge->next_callee)
if (!edge->callee->reachable)
cgraph_mark_reachable_node (edge->callee);
re PR c++/42317 (Issues with comdat virtual dtors) PR c++/42317 * cgraph.h (struct cgraph_node): Add same_comdat_group field. * cgraph.c (cgraph_remove_node): Unchain node from same_comdat_group circular list. (cgraph_node_can_be_local_p): Return false for DECL_COMDAT with node->same_comdat_group. * ipa.c (cgraph_remove_unreachable_nodes): For any reachable node mark all its same_comdat_group nodes as also reachable. (cgraph_externally_visible_p): Return true even if any of same_comdat_group nodes has address taken. * lto-cgraph.c (lto_output_node): Stream out same_comdat_group. (output_cgraph): Ensure other same_comdat_group nodes are also included. (input_node): Stream in same_comdat_group. (input_cgraph_1): Fix up same_comdat_group fields from references to pointers. * cgraphunit.c (cgraph_analyze_functions): Mark all other same_comdat_group nodes as reachable. (cgraph_mark_functions_to_output): For each node->process process also other same_comdat_group nodes. * ipa-inline.c (cgraph_clone_inlined_nodes): Don't reuse nodes with same_comdat_group non-NULL. (cgraph_mark_inline_edge): Likewise. * decl2.c (cp_write_global_declarations): Clear DECL_EXTERNAL also on all other functions in the same comdat group. * optimize.c (maybe_clone_body): Also optimize virtual implicit dtors. For virtual comdat dtors tell cgraph that base and deleting dtor are in the same comdat group. * config/abi/pre/gnu.ver: Don't export certain base dtors that weren't previously exported. * g++.dg/opt/dtor2.C: New test. * g++.dg/opt/dtor2.h: New file. * g++.dg/opt/dtor2-aux.cc: New file. From-SVN: r155143
2009-12-10 22:58:49 +01:00
if (node->same_comdat_group)
{
for (next = node->same_comdat_group;
next != node;
next = next->same_comdat_group)
cgraph_mark_reachable_node (next);
}
/* If decl is a clone of an abstract function, mark that abstract
function so that we don't release its body. The DECL_INITIAL() of that
abstract function declaration will be later needed to output debug info. */
if (DECL_ABSTRACT_ORIGIN (decl))
{
struct cgraph_node *origin_node = cgraph_node (DECL_ABSTRACT_ORIGIN (decl));
origin_node->abstract_and_needed = true;
}
/* We finalize local static variables during constructing callgraph
edges. Process their attributes too. */
process_function_and_variable_attributes (first_processed,
first_analyzed_var);
first_processed = cgraph_nodes;
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
first_analyzed_var = varpool_nodes;
varpool_analyze_pending_decls ();
cgraph_process_new_functions ();
}
/* Collect entry points to the unit. */
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Unit entry points:");
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
for (node = cgraph_nodes; node != first_analyzed; node = node->next)
if (node->needed)
fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
fprintf (cgraph_dump_file, "\n\nInitial ");
dump_cgraph (cgraph_dump_file);
}
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "\nReclaiming functions:");
for (node = cgraph_nodes; node != first_analyzed; node = next)
{
tree decl = node->decl;
next = node->next;
if (node->local.finalized && !gimple_has_body_p (decl))
2006-05-19 00:16:23 +02:00
cgraph_reset_node (node);
if (!node->reachable && gimple_has_body_p (decl))
{
if (cgraph_dump_file)
fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
cgraph_remove_node (node);
continue;
}
else
node->next_needed = NULL;
gcc_assert (!node->local.finalized || gimple_has_body_p (decl));
gcc_assert (node->analyzed == node->local.finalized);
}
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "\n\nReclaimed ");
dump_cgraph (cgraph_dump_file);
}
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
first_analyzed = cgraph_nodes;
ggc_collect ();
}
/* Analyze the whole compilation unit once it is parsed completely. */
void
cgraph_finalize_compilation_unit (void)
{
timevar_push (TV_CGRAPH);
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
/* Do not skip analyzing the functions if there were errors, we
miss diagnostics for following functions otherwise. */
/* Emit size functions we didn't inline. */
cgraphunit.c (cgraph_finalize_compilation_unit): Call finalize_size_functions before further processing. * cgraphunit.c (cgraph_finalize_compilation_unit): Call finalize_size_functions before further processing. * stor-layout.c: Include cgraph.h, tree-inline.h and tree-dump.h. (variable_size): Call self_referential_size on size expressions that contain a PLACEHOLDER_EXPR. (size_functions): New static variable. (copy_self_referential_tree_r): New static function. (self_referential_size): Likewise. (finalize_size_functions): New global function. * tree.c: Include tree-inline.h. (push_without_duplicates): New static function. (find_placeholder_in_expr): New global function. (substitute_in_expr) <tcc_declaration>: Return the replacement object on equality. <tcc_expression>: Likewise. <tcc_vl_exp>: If the replacement object is a constant, try to inline the call in the expression. * tree.h (finalize_size_functions): Declare. (find_placeholder_in_expr): Likewise. (FIND_PLACEHOLDER_IN_EXPR): New macro. (substitute_placeholder_in_expr): Update comment. * tree-inline.c (remap_decl): Do not unshare trees if do_not_unshare is true. (copy_tree_body_r): Likewise. (copy_tree_body): New static function. (maybe_inline_call_in_expr): New global function. * tree-inline.h (struct copy_body_data): Add do_not_unshare field. (maybe_inline_call_in_expr): Declare. * Makefile.in (tree.o): Depend on TREE_INLINE_H. (stor-layout.o): Depend on CGRAPH_H, TREE_INLINE_H, TREE_DUMP_H and GIMPLE_H. ada/ * gcc-interface/decl.c: Include tree-inline.h. (annotate_value) <CALL_EXPR>: Try to inline the call in the expression. * gcc-interface/utils.c (max_size) <CALL_EXPR>: Likewise. * gcc-interface/utils2.c: Include tree-inline. (known_alignment) <CALL_EXPR>: Likewise. From-SVN: r149112
2009-06-30 19:26:32 +02:00
finalize_size_functions ();
/* Call functions declared with the "constructor" or "destructor"
attribute. */
cgraph_build_cdtor_fns ();
/* Mark alias targets necessary and emit diagnostics. */
finish_aliases_1 ();
if (!quiet_flag)
{
fprintf (stderr, "\nAnalyzing compilation unit\n");
fflush (stderr);
}
/* Gimplify and lower all functions, compute reachability and
remove unreachable nodes. */
cgraph_analyze_functions ();
/* Mark alias targets necessary and emit diagnostics. */
finish_aliases_1 ();
/* Gimplify and lower thunks. */
cgraph_analyze_functions ();
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
/* Finally drive the pass manager. */
re PR c/40401 (ICE: verify_gimple failed) 2009-07-17 Richard Guenther <rguenther@suse.de> PR c/40401 * tree-pass.h (pass_diagnose_omp_blocks): Declare. (pass_warn_unused_result): Likewise. (TODO_set_props): Remove. * omp-low.c (diagnose_omp_structured_block_errors): Change to run as a pass. (pass_diagnose_omp_blocks): Define. * c-decl.c (pop_file_scope): Do not finalize the CU here. (c_gimple_diagnostics_recursively): Remove. (finish_function): Do not call it. (c_write_global_declarations): Continue after errors. Finalize the CU here. * c-gimplify.c (c_genericize): Do not gimplify here. * c-common.c (c_warn_unused_result): Move ... * tree-cfg.c (do_warn_unused_result): ... here. (run_warn_unused_result): New function. (gate_warn_unused_result): New function. (pass_warn_unused_result): New pass. * c-common.h (c_warn_unused_result): Remove. * flags.h (flag_warn_unused_result): Declare. * c-opts.c (c_common_init_options): Enable flag_warn_unused_result. * opts.c (flag_warn_unused_result): Initialize to false. * toplev.c (compile_file): Add comment. * omp-low.c (create_omp_child_function): Do not register the function with the frontend. (diagnose_omp_structured_block_errors): Prepare to be called as optimization pass. (gate_diagnose_omp_blocks): New function. (pass_diagnose_omp_blocks): New pass. * cgraph.h (cgraph_optimize): Remove. (cgraph_analyze_function): Likewise. * cgraph.c (cgraph_add_new_function): Gimplify C++ thunks. * cgraphunit.c (cgraph_lower_function): Lower nested functions before their parents here. (cgraph_finalize_function): Not here. (cgraph_analyze_function): Gimplify functions here. (cgraph_finalize_compilation_unit): Continue after errors. Optimize the callgraph from here. (cgraph_optimize): Make static. * langhooks.c (write_global_declarations): Finalize the CU. * gimplify.c (gimplify_asm_expr): Do not emit ASMs with errors. (gimplify_function_tree): Assert we gimplify only once. Set PROP_gimple_any property. * tree-nested.c (gimplify_all_functions): New function. (lower_nested_functions): Gimplify all nested functions. * gimple.h (diagnose_omp_structured_block_errors): Remove. * passes.c (init_optimization_passes): Add pass_warn_unused_result and pass_diagnose_omp_blocks after gimplification. Do not set TODO_set_props on all_lowering_passes. (execute_one_pass): Do not handle TODO_set_props. * Makefile.in (cgraphunit.o): Add $(TREE_DUMP_H) dependency. (gimplify.o): Add tree-pass.h dependency. * tree-inline.c (copy_statement_list): Properly copy STATEMENT_LIST. (copy_tree_body_r): Properly handle TARGET_EXPR like SAVE_EXPR. (unsave_r): Likewise. * c-omp.c (c_finish_omp_atomic): Set DECL_CONTEXT on the temporary variable. cp/ * decl.c (finish_function): Do not emit unused result warnings from here. * cp-objcp-common.h (LANG_HOOKS_POST_GIMPLIFY_PASS): Use c_warn_unused_result_pass. * semantics.c (expand_or_defer_fn): Adjust assertion about IL status. * optimize.c (clone_body): Clone in GENERIC. (maybe_clone_body): Do not clear DECL_SAVED_TREE. * decl2.c (cp_write_global_declarations): Fix body test. Do not call cgraph_optimize. * Make-lang.in (optimize.o): Add tree-iterator.h dependency. * method.c (use_thunk): Register thunk with cgraph_finalize_function. * error.c (function_category): Guard access of DECL_LANG_SPECIFIC. java/ * java-gimplify.c (java_genericize): Do not gimplify here. But replace all local references. (java_gimplify_expr): Do not replace local references here. (java_gimplify_modify_expr): Likewise. * jcf-parse.c (java_parse_file): Do not finalize the CU or optimize the cgraph here. * decl.c (java_replace_reference): Make static. (java_replace_references): New function. (end_java_method): Clear base_decl_map. * java-tree.h (java_replace_references): Declare. (java_replace_reference): Remove. ada/ * utils.c (end_subprog_body): Revert to pre-tuples state. Remove unused parameter. (gnat_gimplify_function): Do not gimplify here. Fold into its only caller and remove. (gnat_builtin_function): Adjust for end_subprog_body signature change. (gnat_write_global_declarations): Also finalize the CU. * misc.c (gnat_parse_file): Do not finalize the CU here. * trans.c (gigi): Revert to pre-tuples state. (Subprogram_Body_to_gnu): Adjust for end_subprog_body signature change. * gigi.h (end_subprog_body): Remove unused parameter. fortran/ * f95-lang.c (gfc_be_parse_file): Do not finalize the CU here. * trans-decl.c (gfc_gimplify_function): Remove. (build_entry_thunks): Do not gimplify here. (create_main_function): Likewise. (gfc_generate_function_code): Likewise. * g++.dg/rtti/crash4.C: New testcase. * g++.dg/torture/20090706-1.C: Likewise. * gcc.dg/redecl-17.c: Likewise. * gfortran.dg/missing_optional_dummy_5.f90: Adjust pattern. * gcc.dg/declspec-9.c: Expect extra error. * gcc.dg/declspec-10.c: Likewise. * gcc.dg/declspec-11.c: Likewise. * gcc.dg/redecl-10.c: Expect extra warnings. * gcc.target/i386/pr39082-1.c: Adjust diagnostic location. * gcc.target/i386/pr39545-1.c: Likewise. * g++.dg/ext/asm3.C: Expect more errors. * g++.dg/gomp/block-1.C: Likewise. * g++.dg/gomp/block-2.C: Likewise. * g++.dg/gomp/block-3.C: Likewise. * g++.dg/gomp/block-5.C: Likewise. * g++.old-deja/g++.jason/report.C: Expect extra warnings. * g++.dg/warn/unused-result1.C: XFAIL. From-SVN: r149750
2009-07-17 17:49:34 +02:00
cgraph_optimize ();
timevar_pop (TV_CGRAPH);
}
/* Figure out what functions we want to assemble. */
static void
cgraph_mark_functions_to_output (void)
{
struct cgraph_node *node;
re PR c++/42317 (Issues with comdat virtual dtors) PR c++/42317 * cgraph.h (struct cgraph_node): Add same_comdat_group field. * cgraph.c (cgraph_remove_node): Unchain node from same_comdat_group circular list. (cgraph_node_can_be_local_p): Return false for DECL_COMDAT with node->same_comdat_group. * ipa.c (cgraph_remove_unreachable_nodes): For any reachable node mark all its same_comdat_group nodes as also reachable. (cgraph_externally_visible_p): Return true even if any of same_comdat_group nodes has address taken. * lto-cgraph.c (lto_output_node): Stream out same_comdat_group. (output_cgraph): Ensure other same_comdat_group nodes are also included. (input_node): Stream in same_comdat_group. (input_cgraph_1): Fix up same_comdat_group fields from references to pointers. * cgraphunit.c (cgraph_analyze_functions): Mark all other same_comdat_group nodes as reachable. (cgraph_mark_functions_to_output): For each node->process process also other same_comdat_group nodes. * ipa-inline.c (cgraph_clone_inlined_nodes): Don't reuse nodes with same_comdat_group non-NULL. (cgraph_mark_inline_edge): Likewise. * decl2.c (cp_write_global_declarations): Clear DECL_EXTERNAL also on all other functions in the same comdat group. * optimize.c (maybe_clone_body): Also optimize virtual implicit dtors. For virtual comdat dtors tell cgraph that base and deleting dtor are in the same comdat group. * config/abi/pre/gnu.ver: Don't export certain base dtors that weren't previously exported. * g++.dg/opt/dtor2.C: New test. * g++.dg/opt/dtor2.h: New file. * g++.dg/opt/dtor2-aux.cc: New file. From-SVN: r155143
2009-12-10 22:58:49 +01:00
#ifdef ENABLE_CHECKING
bool check_same_comdat_groups = false;
for (node = cgraph_nodes; node; node = node->next)
gcc_assert (!node->process);
#endif
for (node = cgraph_nodes; node; node = node->next)
{
tree decl = node->decl;
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
struct cgraph_edge *e;
2006-05-19 00:16:23 +02:00
re PR c++/42317 (Issues with comdat virtual dtors) PR c++/42317 * cgraph.h (struct cgraph_node): Add same_comdat_group field. * cgraph.c (cgraph_remove_node): Unchain node from same_comdat_group circular list. (cgraph_node_can_be_local_p): Return false for DECL_COMDAT with node->same_comdat_group. * ipa.c (cgraph_remove_unreachable_nodes): For any reachable node mark all its same_comdat_group nodes as also reachable. (cgraph_externally_visible_p): Return true even if any of same_comdat_group nodes has address taken. * lto-cgraph.c (lto_output_node): Stream out same_comdat_group. (output_cgraph): Ensure other same_comdat_group nodes are also included. (input_node): Stream in same_comdat_group. (input_cgraph_1): Fix up same_comdat_group fields from references to pointers. * cgraphunit.c (cgraph_analyze_functions): Mark all other same_comdat_group nodes as reachable. (cgraph_mark_functions_to_output): For each node->process process also other same_comdat_group nodes. * ipa-inline.c (cgraph_clone_inlined_nodes): Don't reuse nodes with same_comdat_group non-NULL. (cgraph_mark_inline_edge): Likewise. * decl2.c (cp_write_global_declarations): Clear DECL_EXTERNAL also on all other functions in the same comdat group. * optimize.c (maybe_clone_body): Also optimize virtual implicit dtors. For virtual comdat dtors tell cgraph that base and deleting dtor are in the same comdat group. * config/abi/pre/gnu.ver: Don't export certain base dtors that weren't previously exported. * g++.dg/opt/dtor2.C: New test. * g++.dg/opt/dtor2.h: New file. * g++.dg/opt/dtor2-aux.cc: New file. From-SVN: r155143
2009-12-10 22:58:49 +01:00
gcc_assert (!node->process || node->same_comdat_group);
if (node->process)
continue;
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
for (e = node->callers; e; e = e->next_caller)
if (e->inline_failed)
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
break;
/* We need to output all local functions that are used and not
always inlined, as well as those that are reachable from
outside the current compilation unit. */
if (node->analyzed
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
&& !node->global.inlined_to
2010-04-20 16:49:18 +02:00
&& (node->needed || node->reachable_from_other_partition
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
|| (e && node->reachable))
&& !TREE_ASM_WRITTEN (decl)
&& !DECL_EXTERNAL (decl))
re PR c++/42317 (Issues with comdat virtual dtors) PR c++/42317 * cgraph.h (struct cgraph_node): Add same_comdat_group field. * cgraph.c (cgraph_remove_node): Unchain node from same_comdat_group circular list. (cgraph_node_can_be_local_p): Return false for DECL_COMDAT with node->same_comdat_group. * ipa.c (cgraph_remove_unreachable_nodes): For any reachable node mark all its same_comdat_group nodes as also reachable. (cgraph_externally_visible_p): Return true even if any of same_comdat_group nodes has address taken. * lto-cgraph.c (lto_output_node): Stream out same_comdat_group. (output_cgraph): Ensure other same_comdat_group nodes are also included. (input_node): Stream in same_comdat_group. (input_cgraph_1): Fix up same_comdat_group fields from references to pointers. * cgraphunit.c (cgraph_analyze_functions): Mark all other same_comdat_group nodes as reachable. (cgraph_mark_functions_to_output): For each node->process process also other same_comdat_group nodes. * ipa-inline.c (cgraph_clone_inlined_nodes): Don't reuse nodes with same_comdat_group non-NULL. (cgraph_mark_inline_edge): Likewise. * decl2.c (cp_write_global_declarations): Clear DECL_EXTERNAL also on all other functions in the same comdat group. * optimize.c (maybe_clone_body): Also optimize virtual implicit dtors. For virtual comdat dtors tell cgraph that base and deleting dtor are in the same comdat group. * config/abi/pre/gnu.ver: Don't export certain base dtors that weren't previously exported. * g++.dg/opt/dtor2.C: New test. * g++.dg/opt/dtor2.h: New file. * g++.dg/opt/dtor2-aux.cc: New file. From-SVN: r155143
2009-12-10 22:58:49 +01:00
{
node->process = 1;
if (node->same_comdat_group)
{
struct cgraph_node *next;
for (next = node->same_comdat_group;
next != node;
next = next->same_comdat_group)
next->process = 1;
}
}
else if (node->same_comdat_group)
{
#ifdef ENABLE_CHECKING
check_same_comdat_groups = true;
#endif
}
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
else
{
/* We should've reclaimed all functions that are not needed. */
#ifdef ENABLE_CHECKING
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
if (!node->global.inlined_to
&& gimple_has_body_p (decl)
2010-04-20 16:49:18 +02:00
/* FIXME: in ltrans unit when offline copy is outside partition but inline copies
are inside partition, we can end up not removing the body since we no longer
have analyzed node pointing to it. */
&& !node->in_other_partition
&& !DECL_EXTERNAL (decl))
{
dump_cgraph_node (stderr, node);
internal_error ("failed to reclaim unneeded function");
}
#endif
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gcc_assert (node->global.inlined_to
|| !gimple_has_body_p (decl)
2010-04-20 16:49:18 +02:00
|| node->in_other_partition
|| DECL_EXTERNAL (decl));
}
2006-05-19 00:16:23 +02:00
}
re PR c++/42317 (Issues with comdat virtual dtors) PR c++/42317 * cgraph.h (struct cgraph_node): Add same_comdat_group field. * cgraph.c (cgraph_remove_node): Unchain node from same_comdat_group circular list. (cgraph_node_can_be_local_p): Return false for DECL_COMDAT with node->same_comdat_group. * ipa.c (cgraph_remove_unreachable_nodes): For any reachable node mark all its same_comdat_group nodes as also reachable. (cgraph_externally_visible_p): Return true even if any of same_comdat_group nodes has address taken. * lto-cgraph.c (lto_output_node): Stream out same_comdat_group. (output_cgraph): Ensure other same_comdat_group nodes are also included. (input_node): Stream in same_comdat_group. (input_cgraph_1): Fix up same_comdat_group fields from references to pointers. * cgraphunit.c (cgraph_analyze_functions): Mark all other same_comdat_group nodes as reachable. (cgraph_mark_functions_to_output): For each node->process process also other same_comdat_group nodes. * ipa-inline.c (cgraph_clone_inlined_nodes): Don't reuse nodes with same_comdat_group non-NULL. (cgraph_mark_inline_edge): Likewise. * decl2.c (cp_write_global_declarations): Clear DECL_EXTERNAL also on all other functions in the same comdat group. * optimize.c (maybe_clone_body): Also optimize virtual implicit dtors. For virtual comdat dtors tell cgraph that base and deleting dtor are in the same comdat group. * config/abi/pre/gnu.ver: Don't export certain base dtors that weren't previously exported. * g++.dg/opt/dtor2.C: New test. * g++.dg/opt/dtor2.h: New file. * g++.dg/opt/dtor2-aux.cc: New file. From-SVN: r155143
2009-12-10 22:58:49 +01:00
#ifdef ENABLE_CHECKING
if (check_same_comdat_groups)
for (node = cgraph_nodes; node; node = node->next)
if (node->same_comdat_group && !node->process)
{
tree decl = node->decl;
if (!node->global.inlined_to
&& gimple_has_body_p (decl)
2010-04-20 16:49:18 +02:00
/* FIXME: in ltrans unit when offline copy is outside partition but inline copies
are inside partition, we can end up not removing the body since we no longer
have analyzed node pointing to it. */
&& !node->in_other_partition
re PR c++/42317 (Issues with comdat virtual dtors) PR c++/42317 * cgraph.h (struct cgraph_node): Add same_comdat_group field. * cgraph.c (cgraph_remove_node): Unchain node from same_comdat_group circular list. (cgraph_node_can_be_local_p): Return false for DECL_COMDAT with node->same_comdat_group. * ipa.c (cgraph_remove_unreachable_nodes): For any reachable node mark all its same_comdat_group nodes as also reachable. (cgraph_externally_visible_p): Return true even if any of same_comdat_group nodes has address taken. * lto-cgraph.c (lto_output_node): Stream out same_comdat_group. (output_cgraph): Ensure other same_comdat_group nodes are also included. (input_node): Stream in same_comdat_group. (input_cgraph_1): Fix up same_comdat_group fields from references to pointers. * cgraphunit.c (cgraph_analyze_functions): Mark all other same_comdat_group nodes as reachable. (cgraph_mark_functions_to_output): For each node->process process also other same_comdat_group nodes. * ipa-inline.c (cgraph_clone_inlined_nodes): Don't reuse nodes with same_comdat_group non-NULL. (cgraph_mark_inline_edge): Likewise. * decl2.c (cp_write_global_declarations): Clear DECL_EXTERNAL also on all other functions in the same comdat group. * optimize.c (maybe_clone_body): Also optimize virtual implicit dtors. For virtual comdat dtors tell cgraph that base and deleting dtor are in the same comdat group. * config/abi/pre/gnu.ver: Don't export certain base dtors that weren't previously exported. * g++.dg/opt/dtor2.C: New test. * g++.dg/opt/dtor2.h: New file. * g++.dg/opt/dtor2-aux.cc: New file. From-SVN: r155143
2009-12-10 22:58:49 +01:00
&& !DECL_EXTERNAL (decl))
{
dump_cgraph_node (stderr, node);
internal_error ("failed to reclaim unneeded function");
}
}
#endif
}
/* DECL is FUNCTION_DECL. Initialize datastructures so DECL is a function
in lowered gimple form.
Set current_function_decl and cfun to newly constructed empty function body.
return basic block in the function body. */
static basic_block
init_lowered_empty_function (tree decl)
{
basic_block bb;
current_function_decl = decl;
allocate_struct_function (decl, false);
gimple_register_cfg_hooks ();
init_empty_tree_cfg ();
init_tree_ssa (cfun);
init_ssa_operands ();
cfun->gimple_df->in_ssa_p = true;
DECL_INITIAL (decl) = make_node (BLOCK);
DECL_SAVED_TREE (decl) = error_mark_node;
cfun->curr_properties |=
(PROP_gimple_lcf | PROP_gimple_leh | PROP_cfg | PROP_referenced_vars |
PROP_ssa);
/* Create BB for body of the function and connect it properly. */
bb = create_basic_block (NULL, (void *) 0, ENTRY_BLOCK_PTR);
make_edge (ENTRY_BLOCK_PTR, bb, 0);
make_edge (bb, EXIT_BLOCK_PTR, 0);
return bb;
}
/* Adjust PTR by the constant FIXED_OFFSET, and by the vtable
offset indicated by VIRTUAL_OFFSET, if that is
non-null. THIS_ADJUSTING is nonzero for a this adjusting thunk and
zero for a result adjusting thunk. */
static tree
thunk_adjust (gimple_stmt_iterator * bsi,
tree ptr, bool this_adjusting,
HOST_WIDE_INT fixed_offset, tree virtual_offset)
{
gimple stmt;
tree ret;
if (this_adjusting
&& fixed_offset != 0)
{
stmt = gimple_build_assign (ptr,
fold_build2_loc (input_location,
POINTER_PLUS_EXPR,
TREE_TYPE (ptr), ptr,
size_int (fixed_offset)));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
}
/* If there's a virtual offset, look up that value in the vtable and
adjust the pointer again. */
if (virtual_offset)
{
tree vtabletmp;
tree vtabletmp2;
tree vtabletmp3;
tree offsettmp;
if (!vtable_entry_type)
{
tree vfunc_type = make_node (FUNCTION_TYPE);
TREE_TYPE (vfunc_type) = integer_type_node;
TYPE_ARG_TYPES (vfunc_type) = NULL_TREE;
layout_type (vfunc_type);
vtable_entry_type = build_pointer_type (vfunc_type);
}
vtabletmp =
create_tmp_var (build_pointer_type
(build_pointer_type (vtable_entry_type)), "vptr");
/* The vptr is always at offset zero in the object. */
stmt = gimple_build_assign (vtabletmp,
build1 (NOP_EXPR, TREE_TYPE (vtabletmp),
ptr));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
/* Form the vtable address. */
vtabletmp2 = create_tmp_var (TREE_TYPE (TREE_TYPE (vtabletmp)),
"vtableaddr");
stmt = gimple_build_assign (vtabletmp2,
build1 (INDIRECT_REF,
TREE_TYPE (vtabletmp2), vtabletmp));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
/* Find the entry with the vcall offset. */
stmt = gimple_build_assign (vtabletmp2,
fold_build2_loc (input_location,
POINTER_PLUS_EXPR,
TREE_TYPE (vtabletmp2),
vtabletmp2,
fold_convert (sizetype,
virtual_offset)));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
/* Get the offset itself. */
vtabletmp3 = create_tmp_var (TREE_TYPE (TREE_TYPE (vtabletmp2)),
"vcalloffset");
stmt = gimple_build_assign (vtabletmp3,
build1 (INDIRECT_REF,
TREE_TYPE (vtabletmp3),
vtabletmp2));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
/* Cast to sizetype. */
offsettmp = create_tmp_var (sizetype, "offset");
stmt = gimple_build_assign (offsettmp, fold_convert (sizetype, vtabletmp3));
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
/* Adjust the `this' pointer. */
ptr = fold_build2_loc (input_location,
POINTER_PLUS_EXPR, TREE_TYPE (ptr), ptr,
offsettmp);
}
if (!this_adjusting
&& fixed_offset != 0)
/* Adjust the pointer by the constant. */
{
tree ptrtmp;
if (TREE_CODE (ptr) == VAR_DECL)
ptrtmp = ptr;
else
{
ptrtmp = create_tmp_var (TREE_TYPE (ptr), "ptr");
stmt = gimple_build_assign (ptrtmp, ptr);
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
}
ptr = fold_build2_loc (input_location,
POINTER_PLUS_EXPR, TREE_TYPE (ptrtmp), ptrtmp,
size_int (fixed_offset));
}
/* Emit the statement and gimplify the adjustment expression. */
ret = create_tmp_var (TREE_TYPE (ptr), "adjusted_this");
stmt = gimple_build_assign (ret, ptr);
mark_symbols_for_renaming (stmt);
find_referenced_vars_in (stmt);
gsi_insert_after (bsi, stmt, GSI_NEW_STMT);
return ret;
}
/* Produce assembler for thunk NODE. */
static void
assemble_thunk (struct cgraph_node *node)
{
bool this_adjusting = node->thunk.this_adjusting;
HOST_WIDE_INT fixed_offset = node->thunk.fixed_offset;
HOST_WIDE_INT virtual_value = node->thunk.virtual_value;
tree virtual_offset = NULL;
tree alias = node->thunk.alias;
tree thunk_fndecl = node->decl;
tree a = DECL_ARGUMENTS (thunk_fndecl);
current_function_decl = thunk_fndecl;
if (this_adjusting
&& targetm.asm_out.can_output_mi_thunk (thunk_fndecl, fixed_offset,
virtual_value, alias))
{
const char *fnname;
tree fn_block;
DECL_RESULT (thunk_fndecl)
= build_decl (DECL_SOURCE_LOCATION (thunk_fndecl),
RESULT_DECL, 0, integer_type_node);
fnname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (thunk_fndecl));
/* The back end expects DECL_INITIAL to contain a BLOCK, so we
create one. */
fn_block = make_node (BLOCK);
BLOCK_VARS (fn_block) = a;
DECL_INITIAL (thunk_fndecl) = fn_block;
init_function_start (thunk_fndecl);
cfun->is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
fixed_offset, virtual_value, alias);
assemble_end_function (thunk_fndecl, fnname);
init_insn_lengths ();
free_after_compilation (cfun);
set_cfun (NULL);
TREE_ASM_WRITTEN (thunk_fndecl) = 1;
}
else
{
tree restype;
basic_block bb, then_bb, else_bb, return_bb;
gimple_stmt_iterator bsi;
int nargs = 0;
tree arg;
int i;
tree resdecl;
tree restmp = NULL;
VEC(tree, heap) *vargs;
gimple call;
gimple ret;
DECL_IGNORED_P (thunk_fndecl) = 1;
bitmap_obstack_initialize (NULL);
if (node->thunk.virtual_offset_p)
virtual_offset = size_int (virtual_value);
/* Build the return declaration for the function. */
restype = TREE_TYPE (TREE_TYPE (thunk_fndecl));
if (DECL_RESULT (thunk_fndecl) == NULL_TREE)
{
resdecl = build_decl (input_location, RESULT_DECL, 0, restype);
DECL_ARTIFICIAL (resdecl) = 1;
DECL_IGNORED_P (resdecl) = 1;
DECL_RESULT (thunk_fndecl) = resdecl;
}
else
resdecl = DECL_RESULT (thunk_fndecl);
bb = then_bb = else_bb = return_bb = init_lowered_empty_function (thunk_fndecl);
bsi = gsi_start_bb (bb);
/* Build call to the function being thunked. */
if (!VOID_TYPE_P (restype))
{
if (!is_gimple_reg_type (restype))
{
restmp = resdecl;
cfun->local_decls = tree_cons (NULL_TREE, restmp, cfun->local_decls);
BLOCK_VARS (DECL_INITIAL (current_function_decl)) = restmp;
}
else
restmp = create_tmp_var_raw (restype, "retval");
}
for (arg = a; arg; arg = TREE_CHAIN (arg))
nargs++;
vargs = VEC_alloc (tree, heap, nargs);
if (this_adjusting)
VEC_quick_push (tree, vargs,
thunk_adjust (&bsi,
a, 1, fixed_offset,
virtual_offset));
else
VEC_quick_push (tree, vargs, a);
for (i = 1, arg = TREE_CHAIN (a); i < nargs; i++, arg = TREE_CHAIN (arg))
VEC_quick_push (tree, vargs, arg);
call = gimple_build_call_vec (build_fold_addr_expr_loc (0, alias), vargs);
VEC_free (tree, heap, vargs);
gimple_call_set_cannot_inline (call, true);
gimple_call_set_from_thunk (call, true);
if (restmp)
gimple_call_set_lhs (call, restmp);
gsi_insert_after (&bsi, call, GSI_NEW_STMT);
mark_symbols_for_renaming (call);
find_referenced_vars_in (call);
update_stmt (call);
if (restmp && !this_adjusting)
{
tree true_label = NULL_TREE;
if (TREE_CODE (TREE_TYPE (restmp)) == POINTER_TYPE)
{
gimple stmt;
/* If the return type is a pointer, we need to
protect against NULL. We know there will be an
adjustment, because that's why we're emitting a
thunk. */
then_bb = create_basic_block (NULL, (void *) 0, bb);
return_bb = create_basic_block (NULL, (void *) 0, then_bb);
else_bb = create_basic_block (NULL, (void *) 0, else_bb);
remove_edge (single_succ_edge (bb));
true_label = gimple_block_label (then_bb);
stmt = gimple_build_cond (NE_EXPR, restmp,
fold_convert (TREE_TYPE (restmp),
integer_zero_node),
NULL_TREE, NULL_TREE);
gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
make_edge (bb, then_bb, EDGE_TRUE_VALUE);
make_edge (bb, else_bb, EDGE_FALSE_VALUE);
make_edge (return_bb, EXIT_BLOCK_PTR, 0);
make_edge (then_bb, return_bb, EDGE_FALLTHRU);
make_edge (else_bb, return_bb, EDGE_FALLTHRU);
bsi = gsi_last_bb (then_bb);
}
restmp = thunk_adjust (&bsi, restmp, /*this_adjusting=*/0,
fixed_offset, virtual_offset);
if (true_label)
{
gimple stmt;
bsi = gsi_last_bb (else_bb);
stmt = gimple_build_assign (restmp, fold_convert (TREE_TYPE (restmp),
integer_zero_node));
gsi_insert_after (&bsi, stmt, GSI_NEW_STMT);
bsi = gsi_last_bb (return_bb);
}
}
else
gimple_call_set_tail (call, true);
/* Build return value. */
ret = gimple_build_return (restmp);
gsi_insert_after (&bsi, ret, GSI_NEW_STMT);
delete_unreachable_blocks ();
update_ssa (TODO_update_ssa);
cgraph_remove_same_body_alias (node);
/* Since we want to emit the thunk, we explicitly mark its name as
referenced. */
mark_decl_referenced (thunk_fndecl);
cgraph_add_new_function (thunk_fndecl, true);
bitmap_obstack_release (NULL);
}
current_function_decl = NULL;
}
/* Expand function specified by NODE. */
static void
cgraph_expand_function (struct cgraph_node *node)
{
tree decl = node->decl;
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
/* We ought to not compile any inline clones. */
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (!node->global.inlined_to);
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. (build_cgraph_edges): Likewise. * cgraph.c (cgraph_node): Do not update assembler hash. (cgraph_remove_node): Drop non-unit-at-a-time code. * tree-pass.h (pass_O0_always_inline): Remove. * ipa-reference.c (gate_reference): Remove unit-at-a-time check. * toplev.c (process_options): Flag unit-at-a-time does not imply no section anchors. * cgraphunit.c: Update comments. (decide_is_function_needed): Drop non-unit-at-a-time mode. (cgraph_assemble_pending_functions): Remove. (cgraph_reset_node): Drop non-unit-at-a-time code. (cgraph_finalize_function): Likewise. (cgraph_analyze_function): Likewise. (cgraph_finalize_compilation_unit): Likewise. (cgraph_expand_function): Likewise. (cgraph_optimize): Likesise. (save_inline_function_body): Likewise. * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check. * tree-ssa-alias.c (maybe_be_aliased): Likewise. * ipa-inline.c: Update comments. (enum inlining_mode): remove INLINE_SPEED. (cgraph_clone_inlined_nodes): Drop unit-at-a-time check. (cgraph_mark_inline_edge): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. (cgraph_gate_inlining): Remove. (cgraph_early_inlining): Remove flag_unit_at_a_time checks. (cgraph_gate_early_inlining): Likewise. (gate_inline_passes): Remove. (pass_inline_parameters, pass_ipa_inline): Remove gates. (cgraph_gate_O0_always_inline, cgraph_O0_always_inline, pass_O0_always_inline): Remove. * c-pch.c (c_pch_matching): Remove -funit-at-a-time. * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check. * opts.c (no_unit_at_a_time_default): Remove. (decode_options): Remove flag_unit_at_a_time reset and warning. * opts.h (no_unit_at_a_time_default): Remove. * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword early in GNU dialect. (merge_decls): Update comment; drop unit-at-a-time check. (finish_decl): Likewise. (grok_declaration): Remove flag_inline_trees code. (finish_functions): Return on function returning non-void on all statics. * ipa-tye-escape.c (gate_type_escape_vars): Remove. * cfgexpand.c (expand_one_static_var): Remove. (expand_one_var): Remove expand_one_static_var call. (expand_used_vars_for_block): Remove flag_unit_a_time check. * c-opts.c (c_common_post_options): Remove flag_inline_trees code and flag_unit_at_a-time compatibility checks. * varasm.c (assemble_alias): Remove flag_unit_at_a_time check. * tree-inline.c (flag_inline_trees): Remove. (inlinable_function_p): Don't check it. (expand_call_inline): Remove non-unit-at-a-time code. * tree-inline.h (flag_inline_trees): Remove. * tree-optimize.c (execute_early_local_optimizations): Remove unit-at-a-time checks. (tree_rest_of_compilation): Likewise. * combine.c (setup_incoming_promotions): Likewise. * tree-profile.c (tree_gen_ic_func_profiler): Likewise. * tree-ssa-structalias.c (delete_points_to_sets): Likewise. * passes.c (pass_inline_parameters): Update comments; remove O0_alwaysinline pass. (execute_one_ipa_transform_pass): Do not reset in_gimple_form. (execute_one_pass): Likewise. * i386.c (ix86_function_regparm): Remove unit-at-a-time check. (ix86_function_sseregparm): Likewise. * arm.c (arm_function_in_section_p): Likewise. * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise. * varpool.c: Update comments. (decide_is_variable_needed): Remove unit-at-a-time checks. (varpool_finalize_decl): Likewise. * ada/utils.c (end_subprog_body): Remove inline trees check. * ada/misc.c (gnat_post_options): Do not set flag_inline_trees. * fortran/options.c (gfc_post_options): Remove flag_unline_trees code. * gcc.dg/winline-4.c: Remove. * gcc.dg/pch/valid-3.hs: Remove. * gcc.dg/pch/valid-3.c: Remove. * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning * g++.old-deja/g++.jason/report.C: Likewise. * testsuite/g++.dg/warn/pr23075.C: We get returning void warning instead of control flow warning. * cp/decl.c (duplicate_decls): Update comment and unit-at-a-time. (grogfndecl): Drop flag_inline_trees code. * cp/pt.c (instantiate_decl): Drop flag_iline_trees code. * cp/lex.c (cxx_init): Do not set unit-at-a-time. * java/decl.c: Include cgraph.h (end_java_method): Remove non-unit-at-a-time code. (java_mark_decl_local): Likewise; sanity check that we don't touch finalized nodes. From-SVN: r138140
2008-07-25 15:11:32 +02:00
announce_function (decl);
node->process = 0;
gcc_assert (node->lowered);
/* Generate RTL for the body of DECL. */
tree_rest_of_compilation (decl);
/* Make sure that BE didn't give up on compiling. */
gcc_assert (TREE_ASM_WRITTEN (decl));
current_function_decl = NULL;
re PR c++/3187 (gcc lays down two copies of constructors) PR c++/3187 * cgraph.h (struct cgraph_node): Add same_body and same_body_alias fields. (cgraph_same_body_alias, cgraph_remove_same_body_alias): New prototypes. * cgraphunit.c (cgraph_expand_function, cgraph_emit_thunks, cgraph_materialize_all_clones): Handle same_body aliases. * cgraph.c (cgraph_allocate_node): New function. (cgraph_create_node): Use it. (cgraph_node_for_decl, cgraph_node, cgraph_get_node, cgraph_node_for_asm, cgraph_remove_node): Handle same_body aliases. (cgraph_same_body_alias, cgraph_remove_same_body_alias): New functions. * lto-cgraph.c (lto_output_node): Stream out same_body aliases. (input_node): Stream in same_body aliases. * lto-symtab.c (lto_cgraph_replace_node): Clear node pointers for same_body aliases. (lto_symtab_merge_cgraph_nodes_1): Handle same_body aliases. * cp-tree.h (expand_or_defer_fn_1): New prototype. * decl2.c (cp_write_global_declarations): Mark as !DECL_EXTERNAL also all same_body aliases. * semantics.c (expand_or_defer_fn): Move most of the function except registering with cgraph to ... (expand_or_defer_fn_1): ... here. New function. * optimize.c: Include cgraph.h. (maybe_clone_body): If in charge parm is not used and both base and complete clones are created and are not comdat, tell cgraph they have the same body. * Make-lang.in (cp/optimize.o): Depend on $(CGRAPH_H). * g++.dg/abi/mangle26.C: Also match *C2* definition. * g++.dg/abi/mangle27.C: Likewise. * g++.dg/abi/mangle28.C: Likewise. * g++.dg/abi/mangle29.C: Likewise. From-SVN: r154284
2009-11-18 10:53:52 +01:00
if (node->same_body)
{
struct cgraph_node *alias, *next;
re PR c++/3187 (gcc lays down two copies of constructors) PR c++/3187 * cgraph.h (struct cgraph_node): Add same_body and same_body_alias fields. (cgraph_same_body_alias, cgraph_remove_same_body_alias): New prototypes. * cgraphunit.c (cgraph_expand_function, cgraph_emit_thunks, cgraph_materialize_all_clones): Handle same_body aliases. * cgraph.c (cgraph_allocate_node): New function. (cgraph_create_node): Use it. (cgraph_node_for_decl, cgraph_node, cgraph_get_node, cgraph_node_for_asm, cgraph_remove_node): Handle same_body aliases. (cgraph_same_body_alias, cgraph_remove_same_body_alias): New functions. * lto-cgraph.c (lto_output_node): Stream out same_body aliases. (input_node): Stream in same_body aliases. * lto-symtab.c (lto_cgraph_replace_node): Clear node pointers for same_body aliases. (lto_symtab_merge_cgraph_nodes_1): Handle same_body aliases. * cp-tree.h (expand_or_defer_fn_1): New prototype. * decl2.c (cp_write_global_declarations): Mark as !DECL_EXTERNAL also all same_body aliases. * semantics.c (expand_or_defer_fn): Move most of the function except registering with cgraph to ... (expand_or_defer_fn_1): ... here. New function. * optimize.c: Include cgraph.h. (maybe_clone_body): If in charge parm is not used and both base and complete clones are created and are not comdat, tell cgraph they have the same body. * Make-lang.in (cp/optimize.o): Depend on $(CGRAPH_H). * g++.dg/abi/mangle26.C: Also match *C2* definition. * g++.dg/abi/mangle27.C: Likewise. * g++.dg/abi/mangle28.C: Likewise. * g++.dg/abi/mangle29.C: Likewise. From-SVN: r154284
2009-11-18 10:53:52 +01:00
bool saved_alias = node->alias;
for (alias = node->same_body;
alias && alias->next; alias = alias->next)
;
/* Walk aliases in the order they were created; it is possible that
thunks reffers to the aliases made earlier. */
for (; alias; alias = next)
{
next = alias->previous;
if (!alias->thunk.thunk_p)
assemble_alias (alias->decl,
DECL_ASSEMBLER_NAME (alias->thunk.alias));
else
assemble_thunk (alias);
}
re PR c++/3187 (gcc lays down two copies of constructors) PR c++/3187 * cgraph.h (struct cgraph_node): Add same_body and same_body_alias fields. (cgraph_same_body_alias, cgraph_remove_same_body_alias): New prototypes. * cgraphunit.c (cgraph_expand_function, cgraph_emit_thunks, cgraph_materialize_all_clones): Handle same_body aliases. * cgraph.c (cgraph_allocate_node): New function. (cgraph_create_node): Use it. (cgraph_node_for_decl, cgraph_node, cgraph_get_node, cgraph_node_for_asm, cgraph_remove_node): Handle same_body aliases. (cgraph_same_body_alias, cgraph_remove_same_body_alias): New functions. * lto-cgraph.c (lto_output_node): Stream out same_body aliases. (input_node): Stream in same_body aliases. * lto-symtab.c (lto_cgraph_replace_node): Clear node pointers for same_body aliases. (lto_symtab_merge_cgraph_nodes_1): Handle same_body aliases. * cp-tree.h (expand_or_defer_fn_1): New prototype. * decl2.c (cp_write_global_declarations): Mark as !DECL_EXTERNAL also all same_body aliases. * semantics.c (expand_or_defer_fn): Move most of the function except registering with cgraph to ... (expand_or_defer_fn_1): ... here. New function. * optimize.c: Include cgraph.h. (maybe_clone_body): If in charge parm is not used and both base and complete clones are created and are not comdat, tell cgraph they have the same body. * Make-lang.in (cp/optimize.o): Depend on $(CGRAPH_H). * g++.dg/abi/mangle26.C: Also match *C2* definition. * g++.dg/abi/mangle27.C: Likewise. * g++.dg/abi/mangle28.C: Likewise. * g++.dg/abi/mangle29.C: Likewise. From-SVN: r154284
2009-11-18 10:53:52 +01:00
node->alias = saved_alias;
}
gcc_assert (!cgraph_preserve_function_body_p (decl));
cgraph_release_function_body (node);
/* Eliminate all call edges. This is important so the GIMPLE_CALL no longer
points to the dead function body. */
cgraph_node_remove_callees (node);
cgraph_function_flags_ready = true;
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
/* Return true when CALLER_DECL should be inlined into CALLEE_DECL. */
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
bool
Bring from lto-branch: 2008-09-03 Doug Kwan <dougkwan@google.com> * cgraphbuild.c (initialize_inline_failed): Use cgraph_inline_failed_t enums instead of reason strings. * cgraph.c (cgraph_create_edge): Same. (cgraph_inline_failed_string): New function. * cgraph.h (cgraph_inline_failed_t): New enum type. (cgraph_inline_failed_string): New prototype. (struct cgraph_edge): Change type of INLINED_FAILED from constant char pointer to cgraph_inline_failed_t. (cgraph_inline_p): Adjust prototype to use cgraph_inline_failed_t. (cgraph_default_inline_p): Ditto. * gcc/cgraphunit.c (cgraph_inline_p): Change type of parameter REASON to cgraph_inline_failed_t pointer. * cif-code.def: New file. * ipa-inline.c (cgraph_mark_inline_edge): Use an enum instead of a reason string. (cgraph_check_inline_limits): Change type of REASON to pointer to cgraph_inline_failed_t. Replace reason strings with enums. (cgraph_default_inline_p): Ditto. (cgraph_recursive_inlining_p): Ditto. (update_caller_keys): Change type of FAILED_REASON to cgraph_inline_failed_t. (cgraph_set_inline_failed): Change type of REASON to pointer to cgraph_inline_failed_t. Call cgraph_inline_failed_string to convert enums to strings for text output. (cgraph_decide_inlining_of_small_function): Change FAILED_REASON to be of type cgraph_inline_failed_t. Replace reason strings with enums. Call cgraph_inline_failed_string to covert enums to strings for text output. (cgraph_decide_inlining): Replace reason strings with enums. (cgraph_decide_inlining_incrementally): Change type of FAILED_REASON to cgraph_inline_failed_t type. Call cgraph_inline_failed_string for text output. * tree-inline.c (expand_call_inline): Change type of REASON to cgraph_inline_failed_t. Replace reason strings with enums. Call cgraph_inline_failed_string for text output. * Makefile.in (CGRAPH_H): Add cif-code.def to dependencies. (cgraph.o): Ditto. From-SVN: r145176
2009-03-28 12:08:16 +01:00
cgraph_inline_p (struct cgraph_edge *e, cgraph_inline_failed_t *reason)
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
{
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
*reason = e->inline_failed;
return !e->inline_failed;
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
/* Expand all functions that must be output.
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
Attempt to topologically sort the nodes so function is output when
all called functions are already assembled to allow data to be
propagated across the callgraph. Use a stack to get smaller distance
between a function and its callees (later we may choose to use a more
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
sophisticated algorithm for function reordering; we will likely want
to use subsections to make the output functions appear in top-down
order). */
static void
cgraph_expand_all_functions (void)
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
{
struct cgraph_node *node;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
struct cgraph_node **order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
int order_pos, new_order_pos = 0;
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
int i;
order_pos = cgraph_postorder (order);
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (order_pos == cgraph_n_nodes);
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
/* Garbage collector may remove inline clones we eliminate during
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
optimization. So we must be sure to not reference them. */
for (i = 0; i < order_pos; i++)
if (order[i]->process)
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
order[new_order_pos++] = order[i];
for (i = new_order_pos - 1; i >= 0; i--)
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
{
node = order[i];
if (node->process)
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
{
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (node->reachable);
node->process = 0;
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
cgraph_expand_function (node);
}
}
cgraph_process_new_functions ();
tree-pretty-print.c (dump_generic_node): Handle OMP_PARALLEL_FN, OMP_PARALLEL_DATA_ARG and OMP_RETURN_EXPR. * tree-pretty-print.c (dump_generic_node): Handle OMP_PARALLEL_FN, OMP_PARALLEL_DATA_ARG and OMP_RETURN_EXPR. * cgraph.c (cgraph_expand_queue): Rename from cgraph_analyze_queue. Update all users. * cgraphunit.c (cgraph_assemble_pending_functions): Process cgraph_expand_queue. (cgraph_expand_all_functions): Likewise. (cgraph_finalize_pending_functions): Remove. Update callers. * tree.h (OMP_DIRECTIVE_P): Define. (OMP_PARALLEL_FN): Define. (OMP_PARALLEL_DATA_ARG): Define. (OMP_SECTIONS_SECTIONS): Define. * tree-pass.h (pass_expand_omp): Declare. * omp-low.c (struct omp_region): Declare. (struct omp_context): Remove fields 'parallel_type', 'parallel_start_ix' and 'parallel_start_additional_args'. Update all users. (struct omp_for_data): Rename from struct expand_omp_for_data. (omp_regions): New static variable. (root_omp_region): New static variable. (find_omp_clause): Make static. (is_in_combined_parallel_ctx): Remove. (is_combined_parallel): New. (extract_omp_for_data): Move earlier in the file. (workshare_safe_to_combine_p): New. (get_ws_args_for): New. (determine_parallel_type): Move earlier in the file. (omp_copy_decl_2): Do not set DECL_CONTEXT of new local to the child function. (omp_copy_decl): Likewise. (create_omp_child_function): Likewise. (lookup_omp_region): New. (dump_omp_region): New. (debug_omp_region): New. (debug_all_omp_regions): New. (new_omp_region): New. (scan_omp_parallel): If parallel_nesting_level > 1, the directive is nested within another parallel directive. Set OMP_PARALLEL_FN. (scan_omp_for): Do not try to handle combined parallel+for cases. Remove FIXME comment. (scan_omp_nested): Remove. (scan_omp_1): Do not call scan_omp_nested when parallel_nesting_level is > 1. Do not change the DECL_CONTEXT of local variables found. (lookup_decl_in_outer_ctx): New. (lower_rec_input_clauses): Rename from expand_rec_input_clauses. (lower_lastprivate_clauses): Rename from expand_lastprivate_clauses. (lower_reduction_clauses): Rename from expand_reduction_clauses. (lower_copyprivate_clauses): Rename from expand_copyprivate_clauses. If CTX is nested, lookup VAR in the outer context when building copy assignment. (lower_send_clauses): Rename from expand_send_clauses. If CTX is nested, lookup VAR in the outer context when building copy assignments. (lower_send_shared_vars): Rename from expand_send_shared_vars. If CTX is nested, lookup VAR in the outer context when building copy assignments. (expand_parallel_call): Rename from build_parallel_call. Handle combined parallel+workshare cases. Re-implement to emit code into the CFG. (list2chain): New. (expand_omp_parallel): Re-implement to emit code into the CFG. Call move_sese_region_to_fn to outline the sub-graph containing the parallel region. (expand_omp_for_1): Remove. (expand_omp_for_generic): Re-implement to emit code into the CFG. (expand_omp_for_static_nochunk): Likewise. (expand_omp_for_static_chunk): Likewise. (expand_omp_for): Likewise. (expand_omp_sections): Likewise. (remove_exit_barriers): New. (expand_omp_synch): New. (expand_omp): New. (build_omp_regions_1): New. (build_omp_regions): New. (execute_expand_omp): New. (gate_expand_omp): New. (pass_expand_omp): Define. (lower_omp_sections): Rename from expand_omp_sections. Set OMP_SECTIONS_SECTIONS. (lower_omp_single_simple): Rename from expand_omp_single_simple. (lower_omp_single_copy): Rename from expand_omp_single_copy. (lower_omp_single): Rename from expand_omp_simple. (lower_omp_master): Rename from expand_omp_master. (lower_omp_ordered): Rename from expand_omp_ordered. (lower_omp_critical): Rename from expand_omp_critical. (lower_omp_for_lastprivate): Rename from expand_omp_for_lastprivate. (lower_omp_for): Re-implement. (lower_omp_parallel): Re-implement. (lower_regimplify): Rename from expand_regimplify. (lower_omp_1): Rename from expand_omp_1. If there are syntax errors in the program, replace every OpenMP directive with NOP. Call lower_omp_* instead of expand_omp_*. (lower_omp): Rename from expand_omp. * tree-gimple.c (is_gimple_stmt): Handle OMP_RETURN_EXPR. * tree-gimple.h (enum omp_parallel_type): Remove. (gimple_boolify): Declare extern. (find_omp_clause, determine_parallel_type): Remove. * gimple-low.c (lower_omp_directive): New. (lower_stmt): Call it. (record_vars_into): Move from ... (record_vars): ... here. Call record_vars_into with current_function_decl. * gimplify.c (struct gimplify_ctx): Remove fields combined_pre_p and combined_ctxp. Update users. (get_formal_tmp_var): Add documentation. (gimple_boolify): Make extern. (gimplify_expr_in_ctx): Remove. Update callers. (gimplify_omp_parallel): Do not assume that OMP_PARALLEL_BODY will always be a BIND_EXPR. (gimplify_expr): Handle OMP_RETURN_EXPR. * tree.def (BLOCK): Remove documentation about BLOCK_TYPE_TAGS. (OMP_PARALLEL): Add 3 operands. (OMP_SECTIONS): Add 1 operand. (OMP_RETURN_EXPR): Define. * tree-inline.c (estimate_num_insns_1): Handle OpenMP directives. (copy_tree_r): Restore TREE_CHAIN in OMP_CLAUSE_*. * tree-iterator.c (alloc_stmt_list): Assert that we are not creating a circular free list. (free_stmt_list): Assert that we are not freeing stmt_list_cache. * tree-flow.h (move_sese_region_to_fn): Declare. (record_vars_into): Declare. * tree-cfg.c (make_omp_sections_edges): New. (make_exit_edges): Handle OMP_PARALLEL, OMP_FOR, OMP_SINGLE, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_RETURN_EXPR, OMP_SECTIONS and OMP_SECTION. (is_ctrl_altering_stmt): Return true for OMP_DIRECTIVE_P. (set_bb_for_stmt): Undo change to check currently_expanding_to_rtl. (verify_stmt): Do not handle OMP_DIRECTIVE_P. (gather_blocks_in_sese_region): New. (struct move_stmt_d): Declare. (move_stmt_r): New. (move_block_to_fn): New. (move_sese_region_to_fn): New. * passes.c (init_optimization_passes): Schedule pass_expand_omp after pass_init_datastructures. * tree-ssa-operands.c (get_expr_operands): Handle OMP_PARALLEL, OMP_SECTIONS, OMP_FOR, OMP_RETURN_EXPR, OMP_SINGLE, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL. testsuite/ * testsuite/gcc.dg/gomp/for-13.c: Use -fdump-tree-ompexp. * testsuite/gcc.dg/gomp/critical-1.c: Likewise. * testsuite/gcc.dg/gomp/critical-3.c: Likewise. * testsuite/gcc.dg/gomp/empty.c: Likewise. * testsuite/gcc.dg/gomp/ordered-1.c: Likewise. * testsuite/gcc.dg/gomp/for-4.c: Likewise. * testsuite/gcc.dg/gomp/for-6.c: Likewise. * testsuite/gcc.dg/gomp/master-3.c: Likewise. * testsuite/gcc.dg/gomp/for-8.c: Likewise. * testsuite/gcc.dg/gomp/for-10.c: Likewise. * testsuite/gcc.dg/gomp/for-18.c: Likewise. * testsuite/gcc.dg/gomp/for-5.c: Likewise. * testsuite/gcc.dg/gomp/for-7.c: Likewise. * testsuite/gcc.dg/gomp/for-9.c: Likewise. From-SVN: r109969
2006-01-19 17:55:52 +01:00
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
free (order);
tree-pretty-print.c (dump_generic_node): Handle OMP_PARALLEL_FN, OMP_PARALLEL_DATA_ARG and OMP_RETURN_EXPR. * tree-pretty-print.c (dump_generic_node): Handle OMP_PARALLEL_FN, OMP_PARALLEL_DATA_ARG and OMP_RETURN_EXPR. * cgraph.c (cgraph_expand_queue): Rename from cgraph_analyze_queue. Update all users. * cgraphunit.c (cgraph_assemble_pending_functions): Process cgraph_expand_queue. (cgraph_expand_all_functions): Likewise. (cgraph_finalize_pending_functions): Remove. Update callers. * tree.h (OMP_DIRECTIVE_P): Define. (OMP_PARALLEL_FN): Define. (OMP_PARALLEL_DATA_ARG): Define. (OMP_SECTIONS_SECTIONS): Define. * tree-pass.h (pass_expand_omp): Declare. * omp-low.c (struct omp_region): Declare. (struct omp_context): Remove fields 'parallel_type', 'parallel_start_ix' and 'parallel_start_additional_args'. Update all users. (struct omp_for_data): Rename from struct expand_omp_for_data. (omp_regions): New static variable. (root_omp_region): New static variable. (find_omp_clause): Make static. (is_in_combined_parallel_ctx): Remove. (is_combined_parallel): New. (extract_omp_for_data): Move earlier in the file. (workshare_safe_to_combine_p): New. (get_ws_args_for): New. (determine_parallel_type): Move earlier in the file. (omp_copy_decl_2): Do not set DECL_CONTEXT of new local to the child function. (omp_copy_decl): Likewise. (create_omp_child_function): Likewise. (lookup_omp_region): New. (dump_omp_region): New. (debug_omp_region): New. (debug_all_omp_regions): New. (new_omp_region): New. (scan_omp_parallel): If parallel_nesting_level > 1, the directive is nested within another parallel directive. Set OMP_PARALLEL_FN. (scan_omp_for): Do not try to handle combined parallel+for cases. Remove FIXME comment. (scan_omp_nested): Remove. (scan_omp_1): Do not call scan_omp_nested when parallel_nesting_level is > 1. Do not change the DECL_CONTEXT of local variables found. (lookup_decl_in_outer_ctx): New. (lower_rec_input_clauses): Rename from expand_rec_input_clauses. (lower_lastprivate_clauses): Rename from expand_lastprivate_clauses. (lower_reduction_clauses): Rename from expand_reduction_clauses. (lower_copyprivate_clauses): Rename from expand_copyprivate_clauses. If CTX is nested, lookup VAR in the outer context when building copy assignment. (lower_send_clauses): Rename from expand_send_clauses. If CTX is nested, lookup VAR in the outer context when building copy assignments. (lower_send_shared_vars): Rename from expand_send_shared_vars. If CTX is nested, lookup VAR in the outer context when building copy assignments. (expand_parallel_call): Rename from build_parallel_call. Handle combined parallel+workshare cases. Re-implement to emit code into the CFG. (list2chain): New. (expand_omp_parallel): Re-implement to emit code into the CFG. Call move_sese_region_to_fn to outline the sub-graph containing the parallel region. (expand_omp_for_1): Remove. (expand_omp_for_generic): Re-implement to emit code into the CFG. (expand_omp_for_static_nochunk): Likewise. (expand_omp_for_static_chunk): Likewise. (expand_omp_for): Likewise. (expand_omp_sections): Likewise. (remove_exit_barriers): New. (expand_omp_synch): New. (expand_omp): New. (build_omp_regions_1): New. (build_omp_regions): New. (execute_expand_omp): New. (gate_expand_omp): New. (pass_expand_omp): Define. (lower_omp_sections): Rename from expand_omp_sections. Set OMP_SECTIONS_SECTIONS. (lower_omp_single_simple): Rename from expand_omp_single_simple. (lower_omp_single_copy): Rename from expand_omp_single_copy. (lower_omp_single): Rename from expand_omp_simple. (lower_omp_master): Rename from expand_omp_master. (lower_omp_ordered): Rename from expand_omp_ordered. (lower_omp_critical): Rename from expand_omp_critical. (lower_omp_for_lastprivate): Rename from expand_omp_for_lastprivate. (lower_omp_for): Re-implement. (lower_omp_parallel): Re-implement. (lower_regimplify): Rename from expand_regimplify. (lower_omp_1): Rename from expand_omp_1. If there are syntax errors in the program, replace every OpenMP directive with NOP. Call lower_omp_* instead of expand_omp_*. (lower_omp): Rename from expand_omp. * tree-gimple.c (is_gimple_stmt): Handle OMP_RETURN_EXPR. * tree-gimple.h (enum omp_parallel_type): Remove. (gimple_boolify): Declare extern. (find_omp_clause, determine_parallel_type): Remove. * gimple-low.c (lower_omp_directive): New. (lower_stmt): Call it. (record_vars_into): Move from ... (record_vars): ... here. Call record_vars_into with current_function_decl. * gimplify.c (struct gimplify_ctx): Remove fields combined_pre_p and combined_ctxp. Update users. (get_formal_tmp_var): Add documentation. (gimple_boolify): Make extern. (gimplify_expr_in_ctx): Remove. Update callers. (gimplify_omp_parallel): Do not assume that OMP_PARALLEL_BODY will always be a BIND_EXPR. (gimplify_expr): Handle OMP_RETURN_EXPR. * tree.def (BLOCK): Remove documentation about BLOCK_TYPE_TAGS. (OMP_PARALLEL): Add 3 operands. (OMP_SECTIONS): Add 1 operand. (OMP_RETURN_EXPR): Define. * tree-inline.c (estimate_num_insns_1): Handle OpenMP directives. (copy_tree_r): Restore TREE_CHAIN in OMP_CLAUSE_*. * tree-iterator.c (alloc_stmt_list): Assert that we are not creating a circular free list. (free_stmt_list): Assert that we are not freeing stmt_list_cache. * tree-flow.h (move_sese_region_to_fn): Declare. (record_vars_into): Declare. * tree-cfg.c (make_omp_sections_edges): New. (make_exit_edges): Handle OMP_PARALLEL, OMP_FOR, OMP_SINGLE, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL, OMP_RETURN_EXPR, OMP_SECTIONS and OMP_SECTION. (is_ctrl_altering_stmt): Return true for OMP_DIRECTIVE_P. (set_bb_for_stmt): Undo change to check currently_expanding_to_rtl. (verify_stmt): Do not handle OMP_DIRECTIVE_P. (gather_blocks_in_sese_region): New. (struct move_stmt_d): Declare. (move_stmt_r): New. (move_block_to_fn): New. (move_sese_region_to_fn): New. * passes.c (init_optimization_passes): Schedule pass_expand_omp after pass_init_datastructures. * tree-ssa-operands.c (get_expr_operands): Handle OMP_PARALLEL, OMP_SECTIONS, OMP_FOR, OMP_RETURN_EXPR, OMP_SINGLE, OMP_MASTER, OMP_ORDERED, OMP_CRITICAL. testsuite/ * testsuite/gcc.dg/gomp/for-13.c: Use -fdump-tree-ompexp. * testsuite/gcc.dg/gomp/critical-1.c: Likewise. * testsuite/gcc.dg/gomp/critical-3.c: Likewise. * testsuite/gcc.dg/gomp/empty.c: Likewise. * testsuite/gcc.dg/gomp/ordered-1.c: Likewise. * testsuite/gcc.dg/gomp/for-4.c: Likewise. * testsuite/gcc.dg/gomp/for-6.c: Likewise. * testsuite/gcc.dg/gomp/master-3.c: Likewise. * testsuite/gcc.dg/gomp/for-8.c: Likewise. * testsuite/gcc.dg/gomp/for-10.c: Likewise. * testsuite/gcc.dg/gomp/for-18.c: Likewise. * testsuite/gcc.dg/gomp/for-5.c: Likewise. * testsuite/gcc.dg/gomp/for-7.c: Likewise. * testsuite/gcc.dg/gomp/for-9.c: Likewise. From-SVN: r109969
2006-01-19 17:55:52 +01:00
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
}
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
/* This is used to sort the node types by the cgraph order number. */
basic-block.h (enum profile_status): Break out of struct control_flow_graph. ./: * basic-block.h (enum profile_status): Break out of struct control_flow_graph. * cgraph.h (struct inline_summary): Break out of struct cgraph_local_info. * cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out of struct cgraph_order_sort. * combine.c (enum undo_kind): New enum, broken out of struct undo. * cse.c (struct branch_path): Break out of struct cse_basic_block_data. * except.h (enum eh_region_type): Break out of struct eh_region. * gcc.c (enum add_del): Break out of struct modify_target. * genrecog.c (enum decision_type): Break out of struct decision_test. * ggc-page.c (struct ggc_pch_ondisk): Break out of struct ggc_pch_data. * matrix-reorg.c (struct free_info): Break out of struct matrix_info. * regmove.c (enum match_use): New enum, broken out of struct match. * sched-int.h (enum post_call_group): New enum, broken out of struct deps. (struct deps_reg): Break out of struct deps. * target.h (struct asm_int_op): Break out of struct gcc_target. * tree-eh.c (struct goto_queue_node): Break out of struct leh_tf_state. * tree-inline.h (enum copy_body_cge_which): Break out of copy_body_data. * tree-pass.h (enum opt_pass_type): Break out of struct opt_pass. * c-decl.c (in_struct, struct_types): New static variables. (pushtag): Add loc parameter. Change all callers. (lookup_tag): Add ploc parameter. Change all callers. (check_compound_literal_type): New function. (parser_xref_tag): Add loc parameter. Change all callers. If -Wc++-compat, warn about struct/union/enum types defined within a struct or union. (start_struct): Add enclosing_in_struct, enclosing_struct_types, and loc parameters. Change all callers. Change error calls to error_at, using loc. For a redefinition, if the location of the original definition is known, report it. Set in_struct and struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. (finish_struct): Add new parameters enclosing_in_struct and enclosing_struct_types. Change all callers. Set C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined in the struct. If in a struct, add this struct to struct_types. (start_enum): Add loc parameter. Change all callers. Use error_at for errors, using loc. For a redefinition, if the location of the original definition is known, report it. If in a struct, add this enum type to struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. * c-parser.c (disable_extension_diagnostics): Disable -Wc++-compat. (enable_extension_diagnostics): Reenable -Wc++-compat if appropriate. (c_parser_enum_specifier): Get enum location for start_enum. (c_parser_struct_or_union_specifier): Get struct location for start_struct. Save in_struct and struct_types status between start_struct and finish_struct. (c_parser_cast_expression): Get location of cast. (c_parser_alignof_expression): Get location of type. (c_parser_postfix_expression): Likewise. (c_parser_postfix_expression_after_paren_type): Add type_loc parameter. Change all callers. Call check_compound_literal_type. Use type_loc for error about variable size type. * c-typeck.c (build_external_ref): If -Wc++-compat, warn about a use of an enum constant from an enum type defined in a struct or union. (c_cast_expr): Add loc parameter. Change all callers. If -Wc++-compat, warn about defining a type in a cast. * c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define. (start_enum, start_struct, finish_struct): Update declarations. (parser_xref_tag, c_cast_expr): Update declarations. (check_compound_literal_type): Declare. fortran/: * gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of gfc_omp_clauses. (enum gfc_omp_default_sharing): Likewise. * module.c (enum gfc_rsym_state): New enum, broken out of pointer_info. (enum gfc_wsym_state): Likewise. * parse.c (enum state_order): New enum, broken out of st_state. objc/: * objc-act.c (objc_building_struct): New static variable. (objc_in_struct, objc_struct_types): New static variables. (objc_start_struct, objc_finish_struct): New static functions. (generate_struct_by_value_array): Call objc_start_struct instead of start_struct, and call objc_finish_struct instead of finish_struct. (objc_build_struct, build_objc_symtab_template): Likewise. (build_module_descriptor): Likewise. (build_next_objc_exception_stuff): Likewise. (build_protocol_template): Likewise. (build_method_prototype_list_template): Likewise. (build_method_prototype_template): Likewise. (build_category_template, build_selector_template): Likewise. (build_class_template, build_super_template): Likewise. (build_ivar_template, build_ivar_list_template): Likewise. (build_method_list_template): Likewise. (build_method_template): Likewise. objcp/: * objcp-decl.h (start_struct): Add three new, ignored, macro parameters. (finish_struct): Add two new, ignored, macro parameters. testsuite/: * gcc.dg/Wcxx-compat-7.c: New testcase. * gcc.dg/Wcxx-compat-8.c: New testcase. * gcc.dg/c99-tag-1.c: Recognize new "originally defined here" notes * gcc.dg/pr17188-1.c: Likewise. * gcc.dg/pr39084.c: Likewise. From-SVN: r147358
2009-05-11 03:02:40 +02:00
enum cgraph_order_sort_kind
{
ORDER_UNDEFINED = 0,
ORDER_FUNCTION,
ORDER_VAR,
ORDER_ASM
};
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
struct cgraph_order_sort
{
basic-block.h (enum profile_status): Break out of struct control_flow_graph. ./: * basic-block.h (enum profile_status): Break out of struct control_flow_graph. * cgraph.h (struct inline_summary): Break out of struct cgraph_local_info. * cgraphunit.c (enum cgraph_order_sort_kind): New enum, broken out of struct cgraph_order_sort. * combine.c (enum undo_kind): New enum, broken out of struct undo. * cse.c (struct branch_path): Break out of struct cse_basic_block_data. * except.h (enum eh_region_type): Break out of struct eh_region. * gcc.c (enum add_del): Break out of struct modify_target. * genrecog.c (enum decision_type): Break out of struct decision_test. * ggc-page.c (struct ggc_pch_ondisk): Break out of struct ggc_pch_data. * matrix-reorg.c (struct free_info): Break out of struct matrix_info. * regmove.c (enum match_use): New enum, broken out of struct match. * sched-int.h (enum post_call_group): New enum, broken out of struct deps. (struct deps_reg): Break out of struct deps. * target.h (struct asm_int_op): Break out of struct gcc_target. * tree-eh.c (struct goto_queue_node): Break out of struct leh_tf_state. * tree-inline.h (enum copy_body_cge_which): Break out of copy_body_data. * tree-pass.h (enum opt_pass_type): Break out of struct opt_pass. * c-decl.c (in_struct, struct_types): New static variables. (pushtag): Add loc parameter. Change all callers. (lookup_tag): Add ploc parameter. Change all callers. (check_compound_literal_type): New function. (parser_xref_tag): Add loc parameter. Change all callers. If -Wc++-compat, warn about struct/union/enum types defined within a struct or union. (start_struct): Add enclosing_in_struct, enclosing_struct_types, and loc parameters. Change all callers. Change error calls to error_at, using loc. For a redefinition, if the location of the original definition is known, report it. Set in_struct and struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. (finish_struct): Add new parameters enclosing_in_struct and enclosing_struct_types. Change all callers. Set C_TYPE_DEFINED_IN_STRUCT for all struct/union/enum types defined in the struct. If in a struct, add this struct to struct_types. (start_enum): Add loc parameter. Change all callers. Use error_at for errors, using loc. For a redefinition, if the location of the original definition is known, report it. If in a struct, add this enum type to struct_types. If -Wc++-compat warn if in sizeof, typeof, or alignof. * c-parser.c (disable_extension_diagnostics): Disable -Wc++-compat. (enable_extension_diagnostics): Reenable -Wc++-compat if appropriate. (c_parser_enum_specifier): Get enum location for start_enum. (c_parser_struct_or_union_specifier): Get struct location for start_struct. Save in_struct and struct_types status between start_struct and finish_struct. (c_parser_cast_expression): Get location of cast. (c_parser_alignof_expression): Get location of type. (c_parser_postfix_expression): Likewise. (c_parser_postfix_expression_after_paren_type): Add type_loc parameter. Change all callers. Call check_compound_literal_type. Use type_loc for error about variable size type. * c-typeck.c (build_external_ref): If -Wc++-compat, warn about a use of an enum constant from an enum type defined in a struct or union. (c_cast_expr): Add loc parameter. Change all callers. If -Wc++-compat, warn about defining a type in a cast. * c-tree.h (C_TYPE_DEFINED_IN_STRUCT): Define. (start_enum, start_struct, finish_struct): Update declarations. (parser_xref_tag, c_cast_expr): Update declarations. (check_compound_literal_type): Declare. fortran/: * gfortran.h (enum gfc_omp_sched_kind): New enum, broken out of gfc_omp_clauses. (enum gfc_omp_default_sharing): Likewise. * module.c (enum gfc_rsym_state): New enum, broken out of pointer_info. (enum gfc_wsym_state): Likewise. * parse.c (enum state_order): New enum, broken out of st_state. objc/: * objc-act.c (objc_building_struct): New static variable. (objc_in_struct, objc_struct_types): New static variables. (objc_start_struct, objc_finish_struct): New static functions. (generate_struct_by_value_array): Call objc_start_struct instead of start_struct, and call objc_finish_struct instead of finish_struct. (objc_build_struct, build_objc_symtab_template): Likewise. (build_module_descriptor): Likewise. (build_next_objc_exception_stuff): Likewise. (build_protocol_template): Likewise. (build_method_prototype_list_template): Likewise. (build_method_prototype_template): Likewise. (build_category_template, build_selector_template): Likewise. (build_class_template, build_super_template): Likewise. (build_ivar_template, build_ivar_list_template): Likewise. (build_method_list_template): Likewise. (build_method_template): Likewise. objcp/: * objcp-decl.h (start_struct): Add three new, ignored, macro parameters. (finish_struct): Add two new, ignored, macro parameters. testsuite/: * gcc.dg/Wcxx-compat-7.c: New testcase. * gcc.dg/Wcxx-compat-8.c: New testcase. * gcc.dg/c99-tag-1.c: Recognize new "originally defined here" notes * gcc.dg/pr17188-1.c: Likewise. * gcc.dg/pr39084.c: Likewise. From-SVN: r147358
2009-05-11 03:02:40 +02:00
enum cgraph_order_sort_kind kind;
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
union
{
struct cgraph_node *f;
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
struct varpool_node *v;
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
struct cgraph_asm_node *a;
} u;
};
/* Output all functions, variables, and asm statements in the order
according to their order fields, which is the order in which they
appeared in the file. This implements -fno-toplevel-reorder. In
this mode we may output functions and variables which don't really
need to be output. */
static void
cgraph_output_in_order (void)
{
int max;
struct cgraph_order_sort *nodes;
int i;
struct cgraph_node *pf;
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
struct varpool_node *pv;
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
struct cgraph_asm_node *pa;
max = cgraph_order;
nodes = XCNEWVEC (struct cgraph_order_sort, max);
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
varpool_analyze_pending_decls ();
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
for (pf = cgraph_nodes; pf; pf = pf->next)
{
if (pf->process)
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
{
i = pf->order;
gcc_assert (nodes[i].kind == ORDER_UNDEFINED);
nodes[i].kind = ORDER_FUNCTION;
nodes[i].u.f = pf;
}
}
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
for (pv = varpool_nodes_queue; pv; pv = pv->next_needed)
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
{
i = pv->order;
gcc_assert (nodes[i].kind == ORDER_UNDEFINED);
nodes[i].kind = ORDER_VAR;
nodes[i].u.v = pv;
}
for (pa = cgraph_asm_nodes; pa; pa = pa->next)
{
i = pa->order;
gcc_assert (nodes[i].kind == ORDER_UNDEFINED);
nodes[i].kind = ORDER_ASM;
nodes[i].u.a = pa;
}
/* In toplevel reorder mode we output all statics; mark them as needed. */
for (i = 0; i < max; ++i)
{
if (nodes[i].kind == ORDER_VAR)
{
varpool_mark_needed_node (nodes[i].u.v);
}
}
varpool_empty_needed_queue ();
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
for (i = 0; i < max; ++i)
{
switch (nodes[i].kind)
{
case ORDER_FUNCTION:
nodes[i].u.f->process = 0;
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
cgraph_expand_function (nodes[i].u.f);
break;
case ORDER_VAR:
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
varpool_assemble_decl (nodes[i].u.v);
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
break;
case ORDER_ASM:
assemble_asm (nodes[i].u.a->asm_str);
break;
case ORDER_UNDEFINED:
break;
default:
gcc_unreachable ();
}
}
cgraph_asm_nodes = NULL;
free (nodes);
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
/* Return true when function body of DECL still needs to be kept around
for later re-use. */
bool
cgraph_preserve_function_body_p (tree decl)
{
struct cgraph_node *node;
gcc_assert (cgraph_global_info_ready);
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
/* Look if there is any clone around. */
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
node = cgraph_node (decl);
if (node->clones)
return true;
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
return false;
}
Makefile.in: Adjust dependencies. 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in: Adjust dependencies. * tree-pass.h: Add new passes and passes formerly in tree-optimize.c. * basic-block.h (duplicate_computed_gotos): Remove, it is now static. * alias.c (rest_of_handle_cfg, pass_cfg): New. * bb-reorder.c (duplicate_computed_gotos): Make it static. * cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of rest_of_compilation. * bb-reorder.c (gate_duplicate_computed_gotos, pass_duplicate_computed_gotos, gate_handle_reorder_blocks, rest_of_handle_reorder_blocks, pass_reorder_blocks, gate_handle_partition_blocks, rest_of_handle_partition_blocks, pass_partition_blocks): New. * bt-load.c (gate_handle_branch_target_load_optimize, rest_of_handle_branch_target_load_optimize, pass_branch_target_load_optimize): New. * cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2, pass_jump2): New. * cfglayout.c (pass_insn_locators_initialize): New. * cfgrtl.c (pass_free_cfg): New. * combine.c (gate_handle_combine, rest_of_handle_combine, pass_combine): New. * cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse, gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New. * emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New. * except.c (pass_set_nothrow_function_flags, pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh, pass_rtl_eh): New. * final.c (pass_compute_alignments, rest_of_handle_final, pass_final, rest_of_handle_shorten_branches, pass_shorten_branches, rest_of_clean_state, pass_clean_state): New. * flow.c (pass_recompute_reg_usage, gate_remove_death_notes, rest_of_handle_remove_death_notes, pass_remove_death_notes, rest_of_handle_life, pass_life, rest_of_handle_flow2, pass_flow2): New. * function.c (pass_instantiate_virtual_regs, pass_init_function, rest_of_handle_check_leaf_regs, pass_leaf_regs): New. * gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass, pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse, pass_gcse): New. * global.c (rest_of_handle_global_alloc, pass_global_alloc): New. * ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion, pass_rtl_ifcvt, gate_handle_if_after_combine, rest_of_handle_if_after_combine, pass_if_after_combine, gate_handle_if_after_reload, rest_of_handle_if_after_reload, pass_if_after_reload): New. * integrate.c (pass_initial_value_sets): New. * jump.c (pass_cleanup_barriers, purge_line_number_notes, pass_purge_lineno_notes): New. * mode-switching.c (rest_of_handle_mode_switching, pass_mode_switching): New. * local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New. * loop-init.c (gate_handle_loop2, rest_of_handle_loop2, pass_loop2): New. * loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize, pass_loop_optimize): New. * modulo-sched.c (gate_handle_sms, rest_of_handle_sms, pass_sms): New. * postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2, pass_gcse2): New. * postreload.c (gate_handle_postreload, rest_of_handle_postreload, pass_postreload_cse): New. * profile.c (gate_handle_profiling, pass_profiling, rest_of_handle_branch_prob, pass_branch_prob): New. * recog.c (pass pass_split_for_shorten_branches, gate_do_final_split, pass_split_before_regstack, gate_handle_split_before_regstack, gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2, rest_of_handle_split_all_insns, pass_split_all_insns): New. * reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs, pass_stack_regs): New. * regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove, gate_handle_stack_adjustments, rest_of_handle_stack_adjustments, pass_stack_adjustments): New. * regrename.c (gate_handle_regrename, rest_of_handle_regrename, pass_regrename): New. * reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots, pass_delay_slots, gate_handle_machine_reorg, rest_of_handle_machine_reorg, pass_machine_reorg): New. * rtl.h (extern void purge_line_number_notes): New. * sched-rgn.c (gate_handle_sched, rest_of_handle_sched, gate_handle_sched2, rest_of_handle_sched2, pass_sched, pass_sched2): New. * tracer.c (gate_handle_tracer, rest_of_handle_tracer, pass_tracer): New. * value-prof.c (gate_handle_value_profile_transformations, rest_of_handle_value_profile_transformations, pass_value_profile_transformations): New. * var-tracking.c (gate_handle_var_tracking, pass_variable_tracking): New. * web.c (gate_handle_web, rest_of_handle_web, pass_web): New. * passes.c (open_dump_file, close_dump_file, rest_of_handle_final, rest_of_handle_delay_slots, rest_of_handle_stack_regs, rest_of_handle_variable_tracking, rest_of_handle_machine_reorg, rest_of_handle_old_regalloc, rest_of_handle_regrename, rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks, rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2, rest_of_handle_gcse2, rest_of_handle_regmove, rest_of_handle_tracer, rest_of_handle_if_conversion, rest_of_handle_if_after_combine, rest_of_handle_if_after_reload, rest_of_handle_web, rest_of_handle_branch_prob, rest_of_handle_value_profile_transformations, rest_of_handle_cfg, rest_of_handle_jump_bypass, rest_of_handle_combine, rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2, rest_of_handle_gcse, rest_of_handle_loop_optimize, rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize, rest_of_handle_mode_switching, rest_of_handle_jump, rest_of_handle_eh, rest_of_handle_stack_adjustments, rest_of_handle_flow2, rest_of_handle_jump2, rest_of_handle_peephole2, rest_of_handle_postreload, rest_of_handle_shorten_branches, rest_of_clean_state, rest_of_compilation): Remove. * cgraphunit.c (ipa_passes): Moved from tree-optimize.c. * passes.c (dump_flags, in_gimple_form, all_passes, all_ipa_passes, all_lowering_passes, register_one_dump_file, register_dump_files, next_pass_1, last_verified, execute_todo, execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved from tree-optimize.c. (init_optimization_passes): Moved from tree-optimize.c, adding the RTL optimizations. * tree-dump.h (dump_info_p, dump_flag): Moved from tree.h. * tree-optimize.c (dump_flags, in_gimple_form, all_passes, all_ipa_passes, all_lowering_passes, register_one_dump_file, register_dump_files, next_pass_1, last_verified, execute_todo, execute_one_pass, execute_pass_list, execute_ipa_pass_list, init_tree_optimization_passes, ipa_passes): Delete. * tree-pass.h (enum tree_dump_index): Moved from tree.h, removing the RTL dumps. (TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved from tree.h. (ipa_passes): Remove. (all_passes, all_ipa_passes, all_lowering_passes): Now extern. * tree.h (enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved to tree-pass.h. (dump_info_p, dump_flag): Moved to tree-dump.h. * Makefile.in: Adjust dependencies for tree-pretty-print.c, cgraph.c, opts.c. * passes.c (finish_optimization_passes): Use dump_begin and dump_end, TDI_end. (gate_rest_of_compilation): New. (pass_rest_of_compilation): Use it. (gate_postreload, pass_postreload): New. * toplev.c (general_init): Rename init_tree_optimization_passes. * toplev.h (init_tree_optimization_passes): Rename to init_optimizations_passes. * tree-dump.c (dump_flag): Make static. (dump_files): Remove RTL dumps. * tree-optimize.c (pass_all_optimizations, pass_early_local_passes, pass_cleanup_cfg, pass_free_cfg_annotations, pass_cleanup_cfg_post_optimizing, pass_free_datastructures, pass_init_datastructures, pass_fixup_cfg): Make non-static. * tree-pretty-print.c: Include tree-pass.h. * cgraph.c: Include tree-dump.h. cp: 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in (class.o, decl2.o): Adjust dependencies. * class.c: Include tree-dump.h. * decl2.c: Include tree-dump.h. java: 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in (parse.o): Adjust dependencies. * parse.y: Include tree-dump.h. From-SVN: r101627
2005-07-05 18:20:53 +02:00
static void
ipa_passes (void)
{
Add target hook invoked when cfun changes. 2007-09-05 Sandra Loosemore <sandra@codesourcery.com> gcc/ Add target hook invoked when cfun changes. * doc/tm.texi (TARGET_SET_CURRENT_FUNCTION): Document. * target.h (struct gcc_target): Add set_current_function. * target-def.h (TARGET_SET_CURRENT_FUNCTION): Define. (TARGET_INITIALIZER): Add initializer for set_current_function. * tree.h (push_struct_function): New. * tree-inline.h (push_cfun, pop_cfun): Move declarations to... * function.h: Here. (set_cfun): Declare. * tree-inline.c (cfun_stack, push_cfun, pop_cfun): Moved to... * function.c: Here. (push_function_context_to): Use allocate_struct_function to create null context, not init_dummy_function_start. Use set_cfun. (pop_function_context_from): Use set_cfun. (in_dummy_function): New. (invoke_set_current_function_hook): New. (set_cfun): New. (push_cfun, pop_cfun): Use set_cfun. (push_struct_function): New. (allocate_struct_function): Call invoke_set_current_function_hook before returning. (prepare_function_start): Don't set cfun here. Remove unused argument; fix all callers. (init_dummy_function_start): Fiddle with in_dummy_function. Call push_struct_function. (init_function_start): Set cfun here. (expand_dummy_function_end): Fiddle with in_dummy_function. Pop cfun. * omp-low.c (create_omp_child_function): Use push_struct_function and pop_cfun to save/restore state. (expand_omp_parallel): Remove unused saved_cfun variable. * cgraphunit.c (ipa_passes): Use set_cfun. * gimple-low.c (record_vars_into): Use push_cfun/pop_cfun here. * dwarf2out.c (dwarf2out_abstract_function): Likewise. * matrix-reorg.c (transform_allocation_sites): Likewise. (matrix_reorg): Use set_cfun. * gimplify.c (gimplify_function_tree): Use push_cfun/pop_cfun here. * tree-optimize.c (tree_rest_of_compilation): Remove one redundant assignment to cfun; use set_cfun for the other. * tree-cfg.c (move_sese_region_to_fn): Use set_cfun. (dump_function_to_file): Use push_cfun/pop_cfun here. * c-decl.c (finish_function): Use set_cfun. gcc/ada/ * trans.c (Compilation_unit_to_gnu): Use set_cfun. * utils.c (end_subprog_body): Likewise. gcc/cp/ * decl.c (finish_function): Use set_cfun. * method.c (use_thunk): Likewise. gcc/fortran/ * trans-decl.c (build_entry_thunks): Use set_cfun. (gfc_generate_function_code): Likewise. gcc/java/ * decl.c (finish_method): Use set_cfun. gcc/treelang/ * treetree.c (tree_code_create_function_wrapup): Use set_cfun. From-SVN: r128132
2007-09-05 16:24:54 +02:00
set_cfun (NULL);
current_function_decl = NULL;
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
gimple_register_cfg_hooks ();
Makefile.in: Adjust dependencies. 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in: Adjust dependencies. * tree-pass.h: Add new passes and passes formerly in tree-optimize.c. * basic-block.h (duplicate_computed_gotos): Remove, it is now static. * alias.c (rest_of_handle_cfg, pass_cfg): New. * bb-reorder.c (duplicate_computed_gotos): Make it static. * cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of rest_of_compilation. * bb-reorder.c (gate_duplicate_computed_gotos, pass_duplicate_computed_gotos, gate_handle_reorder_blocks, rest_of_handle_reorder_blocks, pass_reorder_blocks, gate_handle_partition_blocks, rest_of_handle_partition_blocks, pass_partition_blocks): New. * bt-load.c (gate_handle_branch_target_load_optimize, rest_of_handle_branch_target_load_optimize, pass_branch_target_load_optimize): New. * cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2, pass_jump2): New. * cfglayout.c (pass_insn_locators_initialize): New. * cfgrtl.c (pass_free_cfg): New. * combine.c (gate_handle_combine, rest_of_handle_combine, pass_combine): New. * cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse, gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New. * emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New. * except.c (pass_set_nothrow_function_flags, pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh, pass_rtl_eh): New. * final.c (pass_compute_alignments, rest_of_handle_final, pass_final, rest_of_handle_shorten_branches, pass_shorten_branches, rest_of_clean_state, pass_clean_state): New. * flow.c (pass_recompute_reg_usage, gate_remove_death_notes, rest_of_handle_remove_death_notes, pass_remove_death_notes, rest_of_handle_life, pass_life, rest_of_handle_flow2, pass_flow2): New. * function.c (pass_instantiate_virtual_regs, pass_init_function, rest_of_handle_check_leaf_regs, pass_leaf_regs): New. * gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass, pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse, pass_gcse): New. * global.c (rest_of_handle_global_alloc, pass_global_alloc): New. * ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion, pass_rtl_ifcvt, gate_handle_if_after_combine, rest_of_handle_if_after_combine, pass_if_after_combine, gate_handle_if_after_reload, rest_of_handle_if_after_reload, pass_if_after_reload): New. * integrate.c (pass_initial_value_sets): New. * jump.c (pass_cleanup_barriers, purge_line_number_notes, pass_purge_lineno_notes): New. * mode-switching.c (rest_of_handle_mode_switching, pass_mode_switching): New. * local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New. * loop-init.c (gate_handle_loop2, rest_of_handle_loop2, pass_loop2): New. * loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize, pass_loop_optimize): New. * modulo-sched.c (gate_handle_sms, rest_of_handle_sms, pass_sms): New. * postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2, pass_gcse2): New. * postreload.c (gate_handle_postreload, rest_of_handle_postreload, pass_postreload_cse): New. * profile.c (gate_handle_profiling, pass_profiling, rest_of_handle_branch_prob, pass_branch_prob): New. * recog.c (pass pass_split_for_shorten_branches, gate_do_final_split, pass_split_before_regstack, gate_handle_split_before_regstack, gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2, rest_of_handle_split_all_insns, pass_split_all_insns): New. * reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs, pass_stack_regs): New. * regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove, gate_handle_stack_adjustments, rest_of_handle_stack_adjustments, pass_stack_adjustments): New. * regrename.c (gate_handle_regrename, rest_of_handle_regrename, pass_regrename): New. * reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots, pass_delay_slots, gate_handle_machine_reorg, rest_of_handle_machine_reorg, pass_machine_reorg): New. * rtl.h (extern void purge_line_number_notes): New. * sched-rgn.c (gate_handle_sched, rest_of_handle_sched, gate_handle_sched2, rest_of_handle_sched2, pass_sched, pass_sched2): New. * tracer.c (gate_handle_tracer, rest_of_handle_tracer, pass_tracer): New. * value-prof.c (gate_handle_value_profile_transformations, rest_of_handle_value_profile_transformations, pass_value_profile_transformations): New. * var-tracking.c (gate_handle_var_tracking, pass_variable_tracking): New. * web.c (gate_handle_web, rest_of_handle_web, pass_web): New. * passes.c (open_dump_file, close_dump_file, rest_of_handle_final, rest_of_handle_delay_slots, rest_of_handle_stack_regs, rest_of_handle_variable_tracking, rest_of_handle_machine_reorg, rest_of_handle_old_regalloc, rest_of_handle_regrename, rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks, rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2, rest_of_handle_gcse2, rest_of_handle_regmove, rest_of_handle_tracer, rest_of_handle_if_conversion, rest_of_handle_if_after_combine, rest_of_handle_if_after_reload, rest_of_handle_web, rest_of_handle_branch_prob, rest_of_handle_value_profile_transformations, rest_of_handle_cfg, rest_of_handle_jump_bypass, rest_of_handle_combine, rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2, rest_of_handle_gcse, rest_of_handle_loop_optimize, rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize, rest_of_handle_mode_switching, rest_of_handle_jump, rest_of_handle_eh, rest_of_handle_stack_adjustments, rest_of_handle_flow2, rest_of_handle_jump2, rest_of_handle_peephole2, rest_of_handle_postreload, rest_of_handle_shorten_branches, rest_of_clean_state, rest_of_compilation): Remove. * cgraphunit.c (ipa_passes): Moved from tree-optimize.c. * passes.c (dump_flags, in_gimple_form, all_passes, all_ipa_passes, all_lowering_passes, register_one_dump_file, register_dump_files, next_pass_1, last_verified, execute_todo, execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved from tree-optimize.c. (init_optimization_passes): Moved from tree-optimize.c, adding the RTL optimizations. * tree-dump.h (dump_info_p, dump_flag): Moved from tree.h. * tree-optimize.c (dump_flags, in_gimple_form, all_passes, all_ipa_passes, all_lowering_passes, register_one_dump_file, register_dump_files, next_pass_1, last_verified, execute_todo, execute_one_pass, execute_pass_list, execute_ipa_pass_list, init_tree_optimization_passes, ipa_passes): Delete. * tree-pass.h (enum tree_dump_index): Moved from tree.h, removing the RTL dumps. (TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved from tree.h. (ipa_passes): Remove. (all_passes, all_ipa_passes, all_lowering_passes): Now extern. * tree.h (enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved to tree-pass.h. (dump_info_p, dump_flag): Moved to tree-dump.h. * Makefile.in: Adjust dependencies for tree-pretty-print.c, cgraph.c, opts.c. * passes.c (finish_optimization_passes): Use dump_begin and dump_end, TDI_end. (gate_rest_of_compilation): New. (pass_rest_of_compilation): Use it. (gate_postreload, pass_postreload): New. * toplev.c (general_init): Rename init_tree_optimization_passes. * toplev.h (init_tree_optimization_passes): Rename to init_optimizations_passes. * tree-dump.c (dump_flag): Make static. (dump_files): Remove RTL dumps. * tree-optimize.c (pass_all_optimizations, pass_early_local_passes, pass_cleanup_cfg, pass_free_cfg_annotations, pass_cleanup_cfg_post_optimizing, pass_free_datastructures, pass_init_datastructures, pass_fixup_cfg): Make non-static. * tree-pretty-print.c: Include tree-pass.h. * cgraph.c: Include tree-dump.h. cp: 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in (class.o, decl2.o): Adjust dependencies. * class.c: Include tree-dump.h. * decl2.c: Include tree-dump.h. java: 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in (parse.o): Adjust dependencies. * parse.y: Include tree-dump.h. From-SVN: r101627
2005-07-05 18:20:53 +02:00
bitmap_obstack_initialize (NULL);
lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has no address taken. * 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. From-SVN: r152520
2009-10-07 11:01:16 +02:00
cgraphunit.c (plugin.h): Include. 2009-12-01 Grigori Fursin <grigori.fursin@inria.fr> Joern Rennecke <amylaar@spamcop.net> * cgraphunit.c (plugin.h): Include. (ipa_passes): Invoke PLUGIN_ALL_IPA_PASSES_START / PLUGIN_ALL_IPA_PASSES_END at start / end of processing. * gcc-plugin.h (highlev-plugin-common.h, hashtab.h): Include. (enum plugin_event): Define by including plugin.def. Last enumerator is now called PLUGIN_EVENT_FIRST_DYNAMIC. (plugin_event_name): Change type to const char **. (get_event_last, get_named_event_id, unregister_callback): Declare. (register_callback): Change type of event argument to int. (highlev-plugin-common.h): New file. * Makefile.in (GCC_PLUGIN_H): Add highlev-plugin-common.h and $(HASHTAB_H) (tree-optimize.o passes.o): Depend on $(PLUGIN_H). (PLUGIN_HEADERS): Add opts.h, $(PARAMS_H) and plugin.def. (s-header-vars): New rule. (install-plugin): Depend on s-header-vars. Install b-header-vars. * params.c (get_num_compiler_params): New function. * params.h (get_num_compiler_params): Declare. * passes.c (plugin.h): Include. (make_pass_instance): Invoke PLUGIN_NEW_PASS. (do_per_function_toporder, pass_init_dump_file): No longer static. (pass_fini_dump_file): Likewise. (execute_one_pass): Likewise. Invoke PLUGIN_OVERRIDE_GATE and PLUGIN_PASS_EXECUTION. (execute_ipa_pass_list): Invoke PLUGIN_EARLY_GIMPLE_PASSES_START and PLUGIN_EARLY_GIMPLE_PASSES_END. * plugin.c (plugin_event_name_init): New array, defined by including plugin.def. (FMT_FOR_PLUGIN_EVENT): Update. (plugin_event_name): Change type to const char ** and initialize to plugin_event_name_init. (event_tab, event_last, event_horizon): New variable. (get_event_last): New function. (plugin_callbacks_init): New array. (plugin_callbacks: Change type to struct callback_info **. Initialize to plugin_callbacks_init. (htab_event_eq, get_named_event_id, unregister_callback): New function. (invoke_plugin_va_callbacks): Likewise. (register_callback): Change type of event argument to int. Handle new events. Allow dynamic events. (invoke_plugin_callbacks): Likewise. Return success status. (plugins_active_p): Allow dynamic callbacks. * plugin.def: New file. * plugin.h (invoke_plugin_callbacks): Update prototype. (invoke_plugin_va_callbacks): Declare. * tree-optimize.c (plugin.h): Include. (tree_rest_of_compilation): Invoke PLUGIN_ALL_PASSES_START and PLUGIN_ALL_PASSES_END. * tree-pass.h (execute_one_pass, pass_init_dump_file): Declare. (pass_fini_dump_file, do_per_function_toporder): Likewise. * doc/plugin.texi: Document new event types. Co-Authored-By: Joern Rennecke <amylaar@spamcop.net> From-SVN: r154877
2009-12-01 20:12:29 +01:00
invoke_plugin_callbacks (PLUGIN_ALL_IPA_PASSES_START, NULL);
lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has no address taken. * 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. From-SVN: r152520
2009-10-07 11:01:16 +02:00
if (!in_lto_p)
execute_ipa_pass_list (all_small_ipa_passes);
/* If pass_all_early_optimizations was not scheduled, the state of
the cgraph will not be properly updated. Update it now. */
if (cgraph_state < CGRAPH_STATE_IPA_SSA)
cgraph_state = CGRAPH_STATE_IPA_SSA;
if (!in_lto_p)
{
/* Generate coverage variables and constructors. */
coverage_finish ();
/* Process new functions added. */
set_cfun (NULL);
current_function_decl = NULL;
cgraph_process_new_functions ();
cgraphunit.c (plugin.h): Include. 2009-12-01 Grigori Fursin <grigori.fursin@inria.fr> Joern Rennecke <amylaar@spamcop.net> * cgraphunit.c (plugin.h): Include. (ipa_passes): Invoke PLUGIN_ALL_IPA_PASSES_START / PLUGIN_ALL_IPA_PASSES_END at start / end of processing. * gcc-plugin.h (highlev-plugin-common.h, hashtab.h): Include. (enum plugin_event): Define by including plugin.def. Last enumerator is now called PLUGIN_EVENT_FIRST_DYNAMIC. (plugin_event_name): Change type to const char **. (get_event_last, get_named_event_id, unregister_callback): Declare. (register_callback): Change type of event argument to int. (highlev-plugin-common.h): New file. * Makefile.in (GCC_PLUGIN_H): Add highlev-plugin-common.h and $(HASHTAB_H) (tree-optimize.o passes.o): Depend on $(PLUGIN_H). (PLUGIN_HEADERS): Add opts.h, $(PARAMS_H) and plugin.def. (s-header-vars): New rule. (install-plugin): Depend on s-header-vars. Install b-header-vars. * params.c (get_num_compiler_params): New function. * params.h (get_num_compiler_params): Declare. * passes.c (plugin.h): Include. (make_pass_instance): Invoke PLUGIN_NEW_PASS. (do_per_function_toporder, pass_init_dump_file): No longer static. (pass_fini_dump_file): Likewise. (execute_one_pass): Likewise. Invoke PLUGIN_OVERRIDE_GATE and PLUGIN_PASS_EXECUTION. (execute_ipa_pass_list): Invoke PLUGIN_EARLY_GIMPLE_PASSES_START and PLUGIN_EARLY_GIMPLE_PASSES_END. * plugin.c (plugin_event_name_init): New array, defined by including plugin.def. (FMT_FOR_PLUGIN_EVENT): Update. (plugin_event_name): Change type to const char ** and initialize to plugin_event_name_init. (event_tab, event_last, event_horizon): New variable. (get_event_last): New function. (plugin_callbacks_init): New array. (plugin_callbacks: Change type to struct callback_info **. Initialize to plugin_callbacks_init. (htab_event_eq, get_named_event_id, unregister_callback): New function. (invoke_plugin_va_callbacks): Likewise. (register_callback): Change type of event argument to int. Handle new events. Allow dynamic events. (invoke_plugin_callbacks): Likewise. Return success status. (plugins_active_p): Allow dynamic callbacks. * plugin.def: New file. * plugin.h (invoke_plugin_callbacks): Update prototype. (invoke_plugin_va_callbacks): Declare. * tree-optimize.c (plugin.h): Include. (tree_rest_of_compilation): Invoke PLUGIN_ALL_PASSES_START and PLUGIN_ALL_PASSES_END. * tree-pass.h (execute_one_pass, pass_init_dump_file): Declare. (pass_fini_dump_file, do_per_function_toporder): Likewise. * doc/plugin.texi: Document new event types. Co-Authored-By: Joern Rennecke <amylaar@spamcop.net> From-SVN: r154877
2009-12-01 20:12:29 +01:00
execute_ipa_summary_passes
((struct ipa_opt_pass_d *) all_regular_ipa_passes);
ipa-cp.c (ipcp_write_summary, [...]): New functions. * ipa-cp.c (ipcp_write_summary, ipcp_read_summary): New functions. (pass_ipa_cp): Register them. (ipcp_init_stage): Analyze all functions for whopr/lto. (ipcp_propagate_stage): Skip external calls. (ipcp_iterate_stage): Call ipa_update_after_lto_read if needed. * ipa-reference.c (write_node_summary_p): Fix thinko about availability. * cgraphunit.c (ipa_passes): When in lto, ne er produce new summaries; when in ltrans, skip executing of ipa passes since everything should've been done. * ipa-inline.c (cgraph_decide_inlining): Remove FIXMEs. (inline_generate_summary): Likewise. (inline_read_summary): New function. (inline_write_summary): New function. (pass_ipa_inline): Register new hooks. * ipa-prop.c: Inlcude lto-streamer.h (ipa_edge_args_vector): Update declaration. (ipa_count_arguments, ipa_compute_jump_functions, ipa_free_edge_args_substructures): Move ipa_edge_args_vector into ggc. (ipa_write_jump_function, ipa_read_jump_function, ipa_write_node_info, ipa_read_node_info): New static functions. (ipa_prop_write_jump_functions, ipa_prop_read_jump_functions): Update. (duplicate_array): Use xmalloc. (duplicate_ggc_array): New. (ipa_edge_duplication_hook): Use it. (ipa_update_after_lto_read): New function. * ipa-prop.h (ipa_prop_write_jump_functions, ipa_prop_read_jump_functions): Declare. (ipa_pass_through_data, ipa_ancestor_jf_data, ipa_member_ptr_cst, jump_func_value, ipa_member_ptr_cst, ipa_edge_args): Add GTY markers. (ipa_edge_args_vector): Move into GGC. (ipa_check_create_edge_args): Update. (ipa_update_after_lto_read): New. * passes.c (ipa_write_summaries_1): When in wpa, do not write summaries. (ipa_read_summaries): When in ltrans, so not read summaries. * lto-streamer.c (lto_get_section_name): Add LTO_section_jump_functions. * lto-streamer.h (LTO_section_jump_functions): New section. (produce_asm): Declare. * lto-cgraph.c (output_cgraph): Output edges in reverse order. * lto-streamer-out.c (produce_asm): Export. * lto-streamer-in.c: Include tree-pass.h (input_function): Free dominance info when done. (lto_read_body): Push ipa_inline in ltrans stage. * gengtype.c (open_base_files): Add ipa-prop.h into includes. * Makefile.in (GTFILES): Add ipa-prop.h * lto.c (lto_fixup_jump_functions): New function. (lto_fixup_decls): Use it. From-SVN: r153449
2009-10-22 12:02:29 +02:00
}
configure.ac (--enable-lto): Add x86_64-apple-darwin* as a platform that supports LTO. ChangeLog: * configure.ac (--enable-lto): Add x86_64-apple-darwin* as a platform that supports LTO. * configure: Regenerate. gcc/ChangeLog: * config.gcc (i[34567]86-*-darwin*, x86_64-*-darwin*): Add lto-macho as lto_binary_reader. * target.h (struct gcc_target): New hooks lto_start and lto_end. * target-def.h (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END): Define. * cgraphunit.c (ipa_passes): Wrap LTO assembler output generation in lto_start and lto_end calls. (is_elf_or_coff): Rename to maybe_lto_object_file. Add Mach-O magic numbers. (scan_prog_file): Update is_elf_or_coff call. * doc/tm.text (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END): Document. * collect2.c (main): Fix enum comparison. * config/darwin-protos.h (darwin_asm_lto_start, darwin_asm_lto_end): Add prototypes. * darwin9.h (LINK_COMMAND_SPEC): Pass -flto and -fwhopr to the linker. * darwin.h (LINK_COMMAND_SPEC): Likewise. Define TARGET_ASM_LTO_START and TARGET_ASM_LTO_END. * darwin.c: Include obstack.h and lto-streamer.h. (lto_section_names_offset, lto_section_names_obstack, lto_asm_out_file, lto_asm_out_name, saved_asm_out_file): New static global variables. (LTO_SEGMENT_NAME, LTO_NAMES_SECTION): New defines. (darwin_asm_lto_start): New function. Redirect output to asm_out_file to a temporary file. (darwin_asm_lto_end): New function. Restore asm_out_file. (darwin_asm_named_section): For LTO sections, replace the name with the offset of the section name in a string table, and build this table. (darwin_file_start): Initialize global vars for LTO support. (darwin_file_end): If output to asm_out_file was redirected, append it to the proper asm_out_file here. Add the section names section. lto/ChangeLog: * lto.h (struct lto_file_struct): Document offset member. * lto-endian.h: New file. * lto-macho.h: New file. * lto-macho.c: New file. * Make-lang.in: Add rule for lto-macho.o. From-SVN: r159173
2010-05-07 23:37:43 +02:00
/* Some targets need to handle LTO assembler output specially. */
if (flag_generate_lto)
targetm.asm_out.lto_start ();
execute_ipa_summary_passes ((struct ipa_opt_pass_d *) all_lto_gen_passes);
if (!in_lto_p)
ipa_write_summaries ();
configure.ac (--enable-lto): Add x86_64-apple-darwin* as a platform that supports LTO. ChangeLog: * configure.ac (--enable-lto): Add x86_64-apple-darwin* as a platform that supports LTO. * configure: Regenerate. gcc/ChangeLog: * config.gcc (i[34567]86-*-darwin*, x86_64-*-darwin*): Add lto-macho as lto_binary_reader. * target.h (struct gcc_target): New hooks lto_start and lto_end. * target-def.h (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END): Define. * cgraphunit.c (ipa_passes): Wrap LTO assembler output generation in lto_start and lto_end calls. (is_elf_or_coff): Rename to maybe_lto_object_file. Add Mach-O magic numbers. (scan_prog_file): Update is_elf_or_coff call. * doc/tm.text (TARGET_ASM_LTO_START, TARGET_ASM_LTO_END): Document. * collect2.c (main): Fix enum comparison. * config/darwin-protos.h (darwin_asm_lto_start, darwin_asm_lto_end): Add prototypes. * darwin9.h (LINK_COMMAND_SPEC): Pass -flto and -fwhopr to the linker. * darwin.h (LINK_COMMAND_SPEC): Likewise. Define TARGET_ASM_LTO_START and TARGET_ASM_LTO_END. * darwin.c: Include obstack.h and lto-streamer.h. (lto_section_names_offset, lto_section_names_obstack, lto_asm_out_file, lto_asm_out_name, saved_asm_out_file): New static global variables. (LTO_SEGMENT_NAME, LTO_NAMES_SECTION): New defines. (darwin_asm_lto_start): New function. Redirect output to asm_out_file to a temporary file. (darwin_asm_lto_end): New function. Restore asm_out_file. (darwin_asm_named_section): For LTO sections, replace the name with the offset of the section name in a string table, and build this table. (darwin_file_start): Initialize global vars for LTO support. (darwin_file_end): If output to asm_out_file was redirected, append it to the proper asm_out_file here. Add the section names section. lto/ChangeLog: * lto.h (struct lto_file_struct): Document offset member. * lto-endian.h: New file. * lto-macho.h: New file. * lto-macho.c: New file. * Make-lang.in: Add rule for lto-macho.o. From-SVN: r159173
2010-05-07 23:37:43 +02:00
if (flag_generate_lto)
targetm.asm_out.lto_end ();
ipa-cp.c (ipcp_write_summary, [...]): New functions. * ipa-cp.c (ipcp_write_summary, ipcp_read_summary): New functions. (pass_ipa_cp): Register them. (ipcp_init_stage): Analyze all functions for whopr/lto. (ipcp_propagate_stage): Skip external calls. (ipcp_iterate_stage): Call ipa_update_after_lto_read if needed. * ipa-reference.c (write_node_summary_p): Fix thinko about availability. * cgraphunit.c (ipa_passes): When in lto, ne er produce new summaries; when in ltrans, skip executing of ipa passes since everything should've been done. * ipa-inline.c (cgraph_decide_inlining): Remove FIXMEs. (inline_generate_summary): Likewise. (inline_read_summary): New function. (inline_write_summary): New function. (pass_ipa_inline): Register new hooks. * ipa-prop.c: Inlcude lto-streamer.h (ipa_edge_args_vector): Update declaration. (ipa_count_arguments, ipa_compute_jump_functions, ipa_free_edge_args_substructures): Move ipa_edge_args_vector into ggc. (ipa_write_jump_function, ipa_read_jump_function, ipa_write_node_info, ipa_read_node_info): New static functions. (ipa_prop_write_jump_functions, ipa_prop_read_jump_functions): Update. (duplicate_array): Use xmalloc. (duplicate_ggc_array): New. (ipa_edge_duplication_hook): Use it. (ipa_update_after_lto_read): New function. * ipa-prop.h (ipa_prop_write_jump_functions, ipa_prop_read_jump_functions): Declare. (ipa_pass_through_data, ipa_ancestor_jf_data, ipa_member_ptr_cst, jump_func_value, ipa_member_ptr_cst, ipa_edge_args): Add GTY markers. (ipa_edge_args_vector): Move into GGC. (ipa_check_create_edge_args): Update. (ipa_update_after_lto_read): New. * passes.c (ipa_write_summaries_1): When in wpa, do not write summaries. (ipa_read_summaries): When in ltrans, so not read summaries. * lto-streamer.c (lto_get_section_name): Add LTO_section_jump_functions. * lto-streamer.h (LTO_section_jump_functions): New section. (produce_asm): Declare. * lto-cgraph.c (output_cgraph): Output edges in reverse order. * lto-streamer-out.c (produce_asm): Export. * lto-streamer-in.c: Include tree-pass.h (input_function): Free dominance info when done. (lto_read_body): Push ipa_inline in ltrans stage. * gengtype.c (open_base_files): Add ipa-prop.h into includes. * Makefile.in (GTFILES): Add ipa-prop.h * lto.c (lto_fixup_jump_functions): New function. (lto_fixup_decls): Use it. From-SVN: r153449
2009-10-22 12:02:29 +02:00
if (!flag_ltrans)
execute_ipa_pass_list (all_regular_ipa_passes);
cgraphunit.c (plugin.h): Include. 2009-12-01 Grigori Fursin <grigori.fursin@inria.fr> Joern Rennecke <amylaar@spamcop.net> * cgraphunit.c (plugin.h): Include. (ipa_passes): Invoke PLUGIN_ALL_IPA_PASSES_START / PLUGIN_ALL_IPA_PASSES_END at start / end of processing. * gcc-plugin.h (highlev-plugin-common.h, hashtab.h): Include. (enum plugin_event): Define by including plugin.def. Last enumerator is now called PLUGIN_EVENT_FIRST_DYNAMIC. (plugin_event_name): Change type to const char **. (get_event_last, get_named_event_id, unregister_callback): Declare. (register_callback): Change type of event argument to int. (highlev-plugin-common.h): New file. * Makefile.in (GCC_PLUGIN_H): Add highlev-plugin-common.h and $(HASHTAB_H) (tree-optimize.o passes.o): Depend on $(PLUGIN_H). (PLUGIN_HEADERS): Add opts.h, $(PARAMS_H) and plugin.def. (s-header-vars): New rule. (install-plugin): Depend on s-header-vars. Install b-header-vars. * params.c (get_num_compiler_params): New function. * params.h (get_num_compiler_params): Declare. * passes.c (plugin.h): Include. (make_pass_instance): Invoke PLUGIN_NEW_PASS. (do_per_function_toporder, pass_init_dump_file): No longer static. (pass_fini_dump_file): Likewise. (execute_one_pass): Likewise. Invoke PLUGIN_OVERRIDE_GATE and PLUGIN_PASS_EXECUTION. (execute_ipa_pass_list): Invoke PLUGIN_EARLY_GIMPLE_PASSES_START and PLUGIN_EARLY_GIMPLE_PASSES_END. * plugin.c (plugin_event_name_init): New array, defined by including plugin.def. (FMT_FOR_PLUGIN_EVENT): Update. (plugin_event_name): Change type to const char ** and initialize to plugin_event_name_init. (event_tab, event_last, event_horizon): New variable. (get_event_last): New function. (plugin_callbacks_init): New array. (plugin_callbacks: Change type to struct callback_info **. Initialize to plugin_callbacks_init. (htab_event_eq, get_named_event_id, unregister_callback): New function. (invoke_plugin_va_callbacks): Likewise. (register_callback): Change type of event argument to int. Handle new events. Allow dynamic events. (invoke_plugin_callbacks): Likewise. Return success status. (plugins_active_p): Allow dynamic callbacks. * plugin.def: New file. * plugin.h (invoke_plugin_callbacks): Update prototype. (invoke_plugin_va_callbacks): Declare. * tree-optimize.c (plugin.h): Include. (tree_rest_of_compilation): Invoke PLUGIN_ALL_PASSES_START and PLUGIN_ALL_PASSES_END. * tree-pass.h (execute_one_pass, pass_init_dump_file): Declare. (pass_fini_dump_file, do_per_function_toporder): Likewise. * doc/plugin.texi: Document new event types. Co-Authored-By: Joern Rennecke <amylaar@spamcop.net> From-SVN: r154877
2009-12-01 20:12:29 +01:00
invoke_plugin_callbacks (PLUGIN_ALL_IPA_PASSES_END, NULL);
Makefile.in: Adjust dependencies. 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in: Adjust dependencies. * tree-pass.h: Add new passes and passes formerly in tree-optimize.c. * basic-block.h (duplicate_computed_gotos): Remove, it is now static. * alias.c (rest_of_handle_cfg, pass_cfg): New. * bb-reorder.c (duplicate_computed_gotos): Make it static. * cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of rest_of_compilation. * bb-reorder.c (gate_duplicate_computed_gotos, pass_duplicate_computed_gotos, gate_handle_reorder_blocks, rest_of_handle_reorder_blocks, pass_reorder_blocks, gate_handle_partition_blocks, rest_of_handle_partition_blocks, pass_partition_blocks): New. * bt-load.c (gate_handle_branch_target_load_optimize, rest_of_handle_branch_target_load_optimize, pass_branch_target_load_optimize): New. * cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2, pass_jump2): New. * cfglayout.c (pass_insn_locators_initialize): New. * cfgrtl.c (pass_free_cfg): New. * combine.c (gate_handle_combine, rest_of_handle_combine, pass_combine): New. * cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse, gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New. * emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New. * except.c (pass_set_nothrow_function_flags, pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh, pass_rtl_eh): New. * final.c (pass_compute_alignments, rest_of_handle_final, pass_final, rest_of_handle_shorten_branches, pass_shorten_branches, rest_of_clean_state, pass_clean_state): New. * flow.c (pass_recompute_reg_usage, gate_remove_death_notes, rest_of_handle_remove_death_notes, pass_remove_death_notes, rest_of_handle_life, pass_life, rest_of_handle_flow2, pass_flow2): New. * function.c (pass_instantiate_virtual_regs, pass_init_function, rest_of_handle_check_leaf_regs, pass_leaf_regs): New. * gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass, pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse, pass_gcse): New. * global.c (rest_of_handle_global_alloc, pass_global_alloc): New. * ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion, pass_rtl_ifcvt, gate_handle_if_after_combine, rest_of_handle_if_after_combine, pass_if_after_combine, gate_handle_if_after_reload, rest_of_handle_if_after_reload, pass_if_after_reload): New. * integrate.c (pass_initial_value_sets): New. * jump.c (pass_cleanup_barriers, purge_line_number_notes, pass_purge_lineno_notes): New. * mode-switching.c (rest_of_handle_mode_switching, pass_mode_switching): New. * local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New. * loop-init.c (gate_handle_loop2, rest_of_handle_loop2, pass_loop2): New. * loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize, pass_loop_optimize): New. * modulo-sched.c (gate_handle_sms, rest_of_handle_sms, pass_sms): New. * postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2, pass_gcse2): New. * postreload.c (gate_handle_postreload, rest_of_handle_postreload, pass_postreload_cse): New. * profile.c (gate_handle_profiling, pass_profiling, rest_of_handle_branch_prob, pass_branch_prob): New. * recog.c (pass pass_split_for_shorten_branches, gate_do_final_split, pass_split_before_regstack, gate_handle_split_before_regstack, gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2, rest_of_handle_split_all_insns, pass_split_all_insns): New. * reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs, pass_stack_regs): New. * regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove, gate_handle_stack_adjustments, rest_of_handle_stack_adjustments, pass_stack_adjustments): New. * regrename.c (gate_handle_regrename, rest_of_handle_regrename, pass_regrename): New. * reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots, pass_delay_slots, gate_handle_machine_reorg, rest_of_handle_machine_reorg, pass_machine_reorg): New. * rtl.h (extern void purge_line_number_notes): New. * sched-rgn.c (gate_handle_sched, rest_of_handle_sched, gate_handle_sched2, rest_of_handle_sched2, pass_sched, pass_sched2): New. * tracer.c (gate_handle_tracer, rest_of_handle_tracer, pass_tracer): New. * value-prof.c (gate_handle_value_profile_transformations, rest_of_handle_value_profile_transformations, pass_value_profile_transformations): New. * var-tracking.c (gate_handle_var_tracking, pass_variable_tracking): New. * web.c (gate_handle_web, rest_of_handle_web, pass_web): New. * passes.c (open_dump_file, close_dump_file, rest_of_handle_final, rest_of_handle_delay_slots, rest_of_handle_stack_regs, rest_of_handle_variable_tracking, rest_of_handle_machine_reorg, rest_of_handle_old_regalloc, rest_of_handle_regrename, rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks, rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2, rest_of_handle_gcse2, rest_of_handle_regmove, rest_of_handle_tracer, rest_of_handle_if_conversion, rest_of_handle_if_after_combine, rest_of_handle_if_after_reload, rest_of_handle_web, rest_of_handle_branch_prob, rest_of_handle_value_profile_transformations, rest_of_handle_cfg, rest_of_handle_jump_bypass, rest_of_handle_combine, rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2, rest_of_handle_gcse, rest_of_handle_loop_optimize, rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize, rest_of_handle_mode_switching, rest_of_handle_jump, rest_of_handle_eh, rest_of_handle_stack_adjustments, rest_of_handle_flow2, rest_of_handle_jump2, rest_of_handle_peephole2, rest_of_handle_postreload, rest_of_handle_shorten_branches, rest_of_clean_state, rest_of_compilation): Remove. * cgraphunit.c (ipa_passes): Moved from tree-optimize.c. * passes.c (dump_flags, in_gimple_form, all_passes, all_ipa_passes, all_lowering_passes, register_one_dump_file, register_dump_files, next_pass_1, last_verified, execute_todo, execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved from tree-optimize.c. (init_optimization_passes): Moved from tree-optimize.c, adding the RTL optimizations. * tree-dump.h (dump_info_p, dump_flag): Moved from tree.h. * tree-optimize.c (dump_flags, in_gimple_form, all_passes, all_ipa_passes, all_lowering_passes, register_one_dump_file, register_dump_files, next_pass_1, last_verified, execute_todo, execute_one_pass, execute_pass_list, execute_ipa_pass_list, init_tree_optimization_passes, ipa_passes): Delete. * tree-pass.h (enum tree_dump_index): Moved from tree.h, removing the RTL dumps. (TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved from tree.h. (ipa_passes): Remove. (all_passes, all_ipa_passes, all_lowering_passes): Now extern. * tree.h (enum tree_dump_index, TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved to tree-pass.h. (dump_info_p, dump_flag): Moved to tree-dump.h. * Makefile.in: Adjust dependencies for tree-pretty-print.c, cgraph.c, opts.c. * passes.c (finish_optimization_passes): Use dump_begin and dump_end, TDI_end. (gate_rest_of_compilation): New. (pass_rest_of_compilation): Use it. (gate_postreload, pass_postreload): New. * toplev.c (general_init): Rename init_tree_optimization_passes. * toplev.h (init_tree_optimization_passes): Rename to init_optimizations_passes. * tree-dump.c (dump_flag): Make static. (dump_files): Remove RTL dumps. * tree-optimize.c (pass_all_optimizations, pass_early_local_passes, pass_cleanup_cfg, pass_free_cfg_annotations, pass_cleanup_cfg_post_optimizing, pass_free_datastructures, pass_init_datastructures, pass_fixup_cfg): Make non-static. * tree-pretty-print.c: Include tree-pass.h. * cgraph.c: Include tree-dump.h. cp: 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in (class.o, decl2.o): Adjust dependencies. * class.c: Include tree-dump.h. * decl2.c: Include tree-dump.h. java: 2005-07-05 Paolo Bonzini <bonzini@gnu.org> * Makefile.in (parse.o): Adjust dependencies. * parse.y: Include tree-dump.h. From-SVN: r101627
2005-07-05 18:20:53 +02:00
bitmap_obstack_release (NULL);
}
[multiple changes] 2009-09-01 Diego Novillo <dnovillo@google.com> * c-lang.c (lang_hooks): Remove const qualifier. java/ChangeLog * lang.c (lang_hooks): Remove const qualifier. objc/ChangeLog * objc-lang.c (lang_hooks): Remove const qualifier. objcp/ChangeLog * objcp-lang.c (lang_hooks): Remove const qualifier. ada/ChangeLog * gcc-interface/misc.c (lang_hooks): Remove const qualifier. fortran/ChangeLog * f95-lang.c (lang_hooks): Remove const qualifier. cp/ChangeLog * cp-lang.c (lang_hooks): Remove const qualifier. 2009-09-01 Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_node_for_decl): New. * cgraph.h (cgraph_node_for_decl): Declare. * tree.c (host_integerp): Return 0 if T is NULL. 2009-09-01 Diego Novillo <dnovillo@google.com> * tree.h (struct alias_pair): Move from varasm.c. (alias_pairs): Likewise. (TYPE_MAXVAL): Define. (TYPE_MINVAL): Define. (iterative_hash_host_wide_int): Declare. (remove_unreachable_alias_pairs): Declare. * tree-pass.h (pass_ipa_free_lang_data): Declare. * diagnostic.c (default_diagnostic_starter): Make extern. (default_diagnostic_finalizer): Make extern. * diagnostic.h (default_diagnostic_starter): Declare. (default_diagnostic_finalizer): Declare. (default_tree_printer): Declare. * toplev.c (default_tree_printer): Make extern. 2009-09-01 Richard Guenther <rguenther@suse.de> Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_add_new_function): Remove gimplification. * cgraphunit.c (cgraph_expand_function): Do not emit associated thunks from here. (cgraph_emit_thunks): New. (cgraph_optimize): Call it. Return if any IPA pass finds an error. * varasm.c (finish_aliases_1): Ignore errorneous aliases used by thunks. 2009-09-01 Simon Baldwin <simonb@google.com> Rafael Espindola <espindola@google.com> Richard Guenther <rguenther@suse.de> Doug Kwan <dougkwan@google.com> Diego Novillo <dnovillo@google.com> * tree.c: Include tree-pass.h, langhooks-def.h, diagnostic.h, cgraph.h, timevar.h, except.h and debug.h. (free_lang_data_in_type): New. (need_assembler_name_p): New. (free_lang_data_in_block): New. (free_lang_data_in_decl): New. (struct free_lang_data_d): New. (add_tree_to_fld_list): New. (find_decls_types_r): New. (get_eh_types_for_runtime): New. (find_decls_types_in_eh_region): New. (find_decls_types_in_node): New. (find_decls_types_in_var): New. (free_lang_data_in_cgraph): New. (free_lang_data): New. (gate_free_lang_data): New. (pass_ipa_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * timevar.def (TV_IPA_FREE_LANG_DATA): Define. * langhooks.h (struct lang_hooks): Add field free_lang_data. (lang_hooks): Remove const qualifier. * ipa.c (cgraph_remove_unreachable_nodes): Call remove_unreachable_alias_pairs. * except.c (add_type_for_runtime): Check if TYPE has already been converted. (lookup_type_for_runtime): Likewise. (check_handled): Handle converted types. * varasm.c (remove_unreachable_alias_pairs): New. * gimple.c: Include demangle.h. (gimple_decl_printable_name): New. (gimple_fold_obj_type_ref): New. * gimple.h (gimple_decl_printable_name): Declare. (gimple_fold_obj_type_ref): Declare. * passes.c (init_optimization_passes): Add pass pass_ipa_free_lang_data. * langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA. testsuite/ChangeLog 2009-09-01 Diego Novillo <dnovillo@google.com> * gcc.dg/gomp/combined-1.c: Adjust expected pattern. * g++.dg/tree-prof/inline_mismatch_args.C: Likewise. * g++.dg/warn/unit-1.C: Likewise. * g++.dg/ipa/iinline-1.C: Likewise. * g++.dg/template/cond2.C: Adjust expected line location for the error. * g++.dg/template/pr35240.C: Likewise. cp/ChangeLog 2009-09-01 Doug Kwan <dougkwan@google.com> * tree.c (cp_fix_function_decl_p): New. (cp_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H). * decl2.c: Include pointer-set.h. (collect_candidates_for_java_method_aliases): New. (cp_write_global_declarations): Call it. Add local variable CANDIDATES. If set, call build_java_method_aliases. (build_java_method_aliases): Add argument CANDIDATES. Use it to determine if FNDECL should get a hidden alias. * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define. * cp-tree.h (cp_free_lang_data): Declare. 2009-09-03 Richard Guenther <rguenther@suse.de> * method.c (use_thunk): Use cgraph_finalize_function to hand off thunks to the cgraph. * semantics.c (emit_associated_thunks): Do not emit thunks for really extern functions. From-SVN: r151360
2009-09-03 06:07:12 +02:00
/* Perform simple optimizations based on callgraph. */
void
cgraph_optimize (void)
{
if (errorcount || sorrycount)
return;
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
/* Frontend may output common variables after the unit has been finalized.
It is safe to deal with them here as they are always zero initialized. */
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
varpool_analyze_pending_decls ();
timevar_push (TV_CGRAPHOPT);
if (pre_ipa_mem_report)
{
fprintf (stderr, "Memory consumption before IPA\n");
dump_memory_report (false);
}
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
if (!quiet_flag)
fprintf (stderr, "Performing interprocedural optimizations\n");
cgraph_state = CGRAPH_STATE_IPA;
/* Don't run the IPA passes if there was any error or sorry messages. */
if (errorcount == 0 && sorrycount == 0)
ipa_passes ();
[multiple changes] 2009-09-01 Diego Novillo <dnovillo@google.com> * c-lang.c (lang_hooks): Remove const qualifier. java/ChangeLog * lang.c (lang_hooks): Remove const qualifier. objc/ChangeLog * objc-lang.c (lang_hooks): Remove const qualifier. objcp/ChangeLog * objcp-lang.c (lang_hooks): Remove const qualifier. ada/ChangeLog * gcc-interface/misc.c (lang_hooks): Remove const qualifier. fortran/ChangeLog * f95-lang.c (lang_hooks): Remove const qualifier. cp/ChangeLog * cp-lang.c (lang_hooks): Remove const qualifier. 2009-09-01 Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_node_for_decl): New. * cgraph.h (cgraph_node_for_decl): Declare. * tree.c (host_integerp): Return 0 if T is NULL. 2009-09-01 Diego Novillo <dnovillo@google.com> * tree.h (struct alias_pair): Move from varasm.c. (alias_pairs): Likewise. (TYPE_MAXVAL): Define. (TYPE_MINVAL): Define. (iterative_hash_host_wide_int): Declare. (remove_unreachable_alias_pairs): Declare. * tree-pass.h (pass_ipa_free_lang_data): Declare. * diagnostic.c (default_diagnostic_starter): Make extern. (default_diagnostic_finalizer): Make extern. * diagnostic.h (default_diagnostic_starter): Declare. (default_diagnostic_finalizer): Declare. (default_tree_printer): Declare. * toplev.c (default_tree_printer): Make extern. 2009-09-01 Richard Guenther <rguenther@suse.de> Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_add_new_function): Remove gimplification. * cgraphunit.c (cgraph_expand_function): Do not emit associated thunks from here. (cgraph_emit_thunks): New. (cgraph_optimize): Call it. Return if any IPA pass finds an error. * varasm.c (finish_aliases_1): Ignore errorneous aliases used by thunks. 2009-09-01 Simon Baldwin <simonb@google.com> Rafael Espindola <espindola@google.com> Richard Guenther <rguenther@suse.de> Doug Kwan <dougkwan@google.com> Diego Novillo <dnovillo@google.com> * tree.c: Include tree-pass.h, langhooks-def.h, diagnostic.h, cgraph.h, timevar.h, except.h and debug.h. (free_lang_data_in_type): New. (need_assembler_name_p): New. (free_lang_data_in_block): New. (free_lang_data_in_decl): New. (struct free_lang_data_d): New. (add_tree_to_fld_list): New. (find_decls_types_r): New. (get_eh_types_for_runtime): New. (find_decls_types_in_eh_region): New. (find_decls_types_in_node): New. (find_decls_types_in_var): New. (free_lang_data_in_cgraph): New. (free_lang_data): New. (gate_free_lang_data): New. (pass_ipa_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * timevar.def (TV_IPA_FREE_LANG_DATA): Define. * langhooks.h (struct lang_hooks): Add field free_lang_data. (lang_hooks): Remove const qualifier. * ipa.c (cgraph_remove_unreachable_nodes): Call remove_unreachable_alias_pairs. * except.c (add_type_for_runtime): Check if TYPE has already been converted. (lookup_type_for_runtime): Likewise. (check_handled): Handle converted types. * varasm.c (remove_unreachable_alias_pairs): New. * gimple.c: Include demangle.h. (gimple_decl_printable_name): New. (gimple_fold_obj_type_ref): New. * gimple.h (gimple_decl_printable_name): Declare. (gimple_fold_obj_type_ref): Declare. * passes.c (init_optimization_passes): Add pass pass_ipa_free_lang_data. * langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA. testsuite/ChangeLog 2009-09-01 Diego Novillo <dnovillo@google.com> * gcc.dg/gomp/combined-1.c: Adjust expected pattern. * g++.dg/tree-prof/inline_mismatch_args.C: Likewise. * g++.dg/warn/unit-1.C: Likewise. * g++.dg/ipa/iinline-1.C: Likewise. * g++.dg/template/cond2.C: Adjust expected line location for the error. * g++.dg/template/pr35240.C: Likewise. cp/ChangeLog 2009-09-01 Doug Kwan <dougkwan@google.com> * tree.c (cp_fix_function_decl_p): New. (cp_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H). * decl2.c: Include pointer-set.h. (collect_candidates_for_java_method_aliases): New. (cp_write_global_declarations): Call it. Add local variable CANDIDATES. If set, call build_java_method_aliases. (build_java_method_aliases): Add argument CANDIDATES. Use it to determine if FNDECL should get a hidden alias. * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define. * cp-tree.h (cp_free_lang_data): Declare. 2009-09-03 Richard Guenther <rguenther@suse.de> * method.c (use_thunk): Use cgraph_finalize_function to hand off thunks to the cgraph. * semantics.c (emit_associated_thunks): Do not emit thunks for really extern functions. From-SVN: r151360
2009-09-03 06:07:12 +02:00
/* Do nothing else if any IPA pass found errors. */
if (errorcount || sorrycount)
{
timevar_pop (TV_CGRAPHOPT);
return;
}
[multiple changes] 2009-09-01 Diego Novillo <dnovillo@google.com> * c-lang.c (lang_hooks): Remove const qualifier. java/ChangeLog * lang.c (lang_hooks): Remove const qualifier. objc/ChangeLog * objc-lang.c (lang_hooks): Remove const qualifier. objcp/ChangeLog * objcp-lang.c (lang_hooks): Remove const qualifier. ada/ChangeLog * gcc-interface/misc.c (lang_hooks): Remove const qualifier. fortran/ChangeLog * f95-lang.c (lang_hooks): Remove const qualifier. cp/ChangeLog * cp-lang.c (lang_hooks): Remove const qualifier. 2009-09-01 Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_node_for_decl): New. * cgraph.h (cgraph_node_for_decl): Declare. * tree.c (host_integerp): Return 0 if T is NULL. 2009-09-01 Diego Novillo <dnovillo@google.com> * tree.h (struct alias_pair): Move from varasm.c. (alias_pairs): Likewise. (TYPE_MAXVAL): Define. (TYPE_MINVAL): Define. (iterative_hash_host_wide_int): Declare. (remove_unreachable_alias_pairs): Declare. * tree-pass.h (pass_ipa_free_lang_data): Declare. * diagnostic.c (default_diagnostic_starter): Make extern. (default_diagnostic_finalizer): Make extern. * diagnostic.h (default_diagnostic_starter): Declare. (default_diagnostic_finalizer): Declare. (default_tree_printer): Declare. * toplev.c (default_tree_printer): Make extern. 2009-09-01 Richard Guenther <rguenther@suse.de> Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_add_new_function): Remove gimplification. * cgraphunit.c (cgraph_expand_function): Do not emit associated thunks from here. (cgraph_emit_thunks): New. (cgraph_optimize): Call it. Return if any IPA pass finds an error. * varasm.c (finish_aliases_1): Ignore errorneous aliases used by thunks. 2009-09-01 Simon Baldwin <simonb@google.com> Rafael Espindola <espindola@google.com> Richard Guenther <rguenther@suse.de> Doug Kwan <dougkwan@google.com> Diego Novillo <dnovillo@google.com> * tree.c: Include tree-pass.h, langhooks-def.h, diagnostic.h, cgraph.h, timevar.h, except.h and debug.h. (free_lang_data_in_type): New. (need_assembler_name_p): New. (free_lang_data_in_block): New. (free_lang_data_in_decl): New. (struct free_lang_data_d): New. (add_tree_to_fld_list): New. (find_decls_types_r): New. (get_eh_types_for_runtime): New. (find_decls_types_in_eh_region): New. (find_decls_types_in_node): New. (find_decls_types_in_var): New. (free_lang_data_in_cgraph): New. (free_lang_data): New. (gate_free_lang_data): New. (pass_ipa_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * timevar.def (TV_IPA_FREE_LANG_DATA): Define. * langhooks.h (struct lang_hooks): Add field free_lang_data. (lang_hooks): Remove const qualifier. * ipa.c (cgraph_remove_unreachable_nodes): Call remove_unreachable_alias_pairs. * except.c (add_type_for_runtime): Check if TYPE has already been converted. (lookup_type_for_runtime): Likewise. (check_handled): Handle converted types. * varasm.c (remove_unreachable_alias_pairs): New. * gimple.c: Include demangle.h. (gimple_decl_printable_name): New. (gimple_fold_obj_type_ref): New. * gimple.h (gimple_decl_printable_name): Declare. (gimple_fold_obj_type_ref): Declare. * passes.c (init_optimization_passes): Add pass pass_ipa_free_lang_data. * langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA. testsuite/ChangeLog 2009-09-01 Diego Novillo <dnovillo@google.com> * gcc.dg/gomp/combined-1.c: Adjust expected pattern. * g++.dg/tree-prof/inline_mismatch_args.C: Likewise. * g++.dg/warn/unit-1.C: Likewise. * g++.dg/ipa/iinline-1.C: Likewise. * g++.dg/template/cond2.C: Adjust expected line location for the error. * g++.dg/template/pr35240.C: Likewise. cp/ChangeLog 2009-09-01 Doug Kwan <dougkwan@google.com> * tree.c (cp_fix_function_decl_p): New. (cp_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H). * decl2.c: Include pointer-set.h. (collect_candidates_for_java_method_aliases): New. (cp_write_global_declarations): Call it. Add local variable CANDIDATES. If set, call build_java_method_aliases. (build_java_method_aliases): Add argument CANDIDATES. Use it to determine if FNDECL should get a hidden alias. * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define. * cp-tree.h (cp_free_lang_data): Declare. 2009-09-03 Richard Guenther <rguenther@suse.de> * method.c (use_thunk): Use cgraph_finalize_function to hand off thunks to the cgraph. * semantics.c (emit_associated_thunks): Do not emit thunks for really extern functions. From-SVN: r151360
2009-09-03 06:07:12 +02:00
/* This pass remove bodies of extern inline functions we never inlined.
Do this later so other IPA passes see what is really going on. */
cgraph_remove_unreachable_nodes (false, dump_file);
cgraph_global_info_ready = true;
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Optimized ");
dump_cgraph (cgraph_dump_file);
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
dump_varpool (cgraph_dump_file);
}
if (post_ipa_mem_report)
{
fprintf (stderr, "Memory consumption after IPA\n");
dump_memory_report (false);
}
timevar_pop (TV_CGRAPHOPT);
cgraph.c (cgraph_max_uid): New global variable. * cgraph.c (cgraph_max_uid): New global variable. (cgraph_node): Set uid field. (create_edge): Keep inline flags consistent. (dump_cgraph): Dump more info. * cgraph.h (struct cgraph_local_info): Remove inline_many and can_inline_once; add inlinable, disgread_inline_limits, and self_insn (struct cgraph_global_info): Add insns, calls, cloned_times, will_be_output. (struct cgraph_node): Add uid. (struct cgraph_edge): Add inline_call. (cgraph_max_uid, cgraph_inline_p): Declare. * cgraph.c: Include params.h and fibheap.h (cgraph_mark_functions_to_inline_once): Kill. (INSNS_PER_CALL): New constant. (ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns): New static variables. (cgraph_finalize_function): Do not analyze inlining. (cgraph_finalize_compilation_unit): Set inlining attributes. (cgraph_mark_functions_to_output): More consistency checks. (cgraph_optimize_function): Set current_function_decl to NULL. (cgraph_expand_function): Use new inline flags. (cgraph_postorder): Expand from cgraph_expand_functions. (INLINED_TIMES, SET_INLINED_TIMES): New macros. (cgraph_inlined_into, cgraph_inlined_callees, cgraph_estimate_size_after_inlining, cgraph_estimate_growth, cgraph_mark_inline, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_decide_inling_of_small_functions, cgraph_decide_inlining, cgraph_inline_p): New functions. * params.def (PARAM_LARGE_FUNCTION_INSNS, PARAM_LARGE_FUNCTION_GROWTH, PARAM_INLINE_UNIT_GROWTH): New parameters. * tree-inline.c (struct inline_data): New field current_decl. (expand_call_inline): Avoid forward declarations; use inlinable_function_p. (optimize_inline_calls): Set id.current_decl. Co-Authored-By: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> From-SVN: r69262
2003-07-12 03:07:40 +02:00
/* Output everything. */
(*debug_hooks->assembly_start) ();
if (!quiet_flag)
fprintf (stderr, "Assembling functions:\n");
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
cgraph_materialize_all_clones ();
cgraph_mark_functions_to_output ();
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
cgraph_state = CGRAPH_STATE_EXPANSION;
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
if (!flag_toplevel_reorder)
cgraph_output_in_order ();
else
{
cgraph_output_pending_asms ();
cgraph_expand_all_functions ();
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
varpool_remove_unreferenced_decls ();
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
Move all varpool routines out of cgraph/cgraphunit to varpool.c Move all varpool routines out of cgraph/cgraphunit to varpool.c * cgraph.c: Update comments. (cgraph_varpool_hash, cgraph_varpool_nodes, cgraph_varpool_last_needed_node cgraph_varpool_node_name, cgraph_varpool_node, cgraph_varpol_mode_for_asm, cgraph_varpool_mark_needed_node, cgraph_variable_initializer_availability): Move to varpool.c and drop cgraph_ prefixes. (cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_finalize_decl): move to varpool.c; drop cgraph_ prefix; make static. (dump_cgraph_varpool_node): Move to varpool.c under name dump_varpool_node. (dump_varpool, hash_varpool_node, eq_varpool_node, decide_is_variable_needed): Move to varpool.c (decl_assembler_name_equal): Move to tree.c. (availability_names): Rename to ... (cgraph_availability_names): ... this one. (dump_cgraph_node): Update. * cgraph.h: Reorder declarations now in varpool.c (cgraph_vailablity_names): Declare. (struct cgraph_varpool_node): Rename to ... (struct varpool_node): ... this one. (cgraph_varpool_first_unanalyzed_node, cgraph_varpool_nodes_queue, cgraph_varpool_first_unanalyzed_node, cgraph_varpool_node, cgraph_varpool_node_for_asm, cgraph_varpool_mark_needed_node, cgraph_varpool_finalize_decl, cgraph_varpool_enqueue_needed_node, cgraph_varpool_reset_queue, cgraph_varpool_assemble_pending_decls, cgraph_variable_initializer_availability): Rename to ... (varpool_first_unanalyzed_node, varpool_nodes_queue, varpool_first_unanalyzed_node, varpool_node, varpool_node_for_asm, varpool_mark_needed_node, varpool_finalize_decl, varpool_enqueue_needed_node, varpool_assemble_pending_decls, variable_initializer_availability): Rename to ... * tree.c (decl_assembler_name_equal): Move here from cgraph.c. * tree.h (decl_assembler_name_equal): Declare. * omp-low.c (lower_omp_critical): Update. * ipa-reference (analyze_variable, static_execute): Likewise. * toplev.c (wrapup_global_declaration_2, compile_file): Update. * cgraphunit.c: Update comments. (cgraph_varpool_assembled_nodes_queue): Move to varpool.c under name varpool_assembled_nodes_queue. (cgraph_varpool_analyze_pending_decls): Move to varpool.c under name varpool_analyze_pending_decls. (cgraph_varpool_remove_unreferenced_decls): Move to varpool.c under name varpool_remove_unreferenced_decls. (record_reference): Update. (cgraph_create_edges): Update. (record_referneces_in_initializer): New function. (cgraph_varpool_assemble_decl): Move to varpool.c under name varpool_assemble_decl; make global. (cgraph_varpool_assemble_pending_decls): Move to varpool.c under name varpool_assemble_pending_decls. (process_function_and_variable_attributes, cgraph_finalize_compilation_unit, struct cgraph_order_sort, cgraph_output_in_order, cgraph_function_and_variable_invisibility, cgraph_optimize, cgraph_increase_alignment): Update. * dwarf2out.c (decls_for_scope): Likewise. * ipa-type-escape.c (analyze_variable, type_escape_execute): Likewise. * except.c (output_ttype): Likewise. * varasm.c (mark_decl_referenced): Likewise. (find_decl_and_mark_referenced, assemble_alias): update. * Makefile.in: Add varpool.c, gt-varpool.c and remove gt-cgraphunit.c * passes.c (rest_of_decl_compilation): Update. * cp/decl2.c (var_finalized_p): Update for renamed varpool functions. * fortran/f59-lang.c (gfc_expand_function): Update for renamed varpool functions. From-SVN: r119731
2006-12-11 09:07:52 +01:00
varpool_assemble_pending_decls ();
common.opt (ftoplevel-reorder): New option. ./: * common.opt (ftoplevel-reorder): New option. * cgraph.c (cgraph_asm_nodes): New global variable. (cgraph_asm_last_node): New static variable. (cgraph_order): New global variable. (cgraph_create_node): Set new order field. (cgraph_varpool_node): Likewise. (decide_is_variable_needed): Return true if not flag_toplevel_reorder. (cgraph_add_asm_node): New function. * cgraph.h (struct cgraph_node): Add order field. (struct cgraph_varpool_node): Add order field. (struct cgraph_asm_node): Define. (cgraph_asm_nodes, cgraph_order): Declare. (cgraph_add_asm_node): Declare. * cgraphunit.c (cgraph_varpool_assemble_decl): New static function. (cgraph_varpool_assemble_pending_decls): Call it. (cgraph_output_pending_asms): New static function. (cgraph_finalize_compilation_unit): Call it. (struct cgraph_order_sort): Define. (cgraph_output_in_order): New static function. (cgraph_optimize): Call cgraph_output_pending_asms. Add code for !flag_toplevel_reorder case. * c-parser.c: Include "cgraph.h". (c_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. * Makefile.in (CRTSTUFF_CFLAGS): Use -fno-toplevel-reorder rather than -fno-unit-at-a-time. * doc/invoke.texi (Option Summary): Mention -fno-toplevel-reorder. (Optimize Options): Document -fno-toplevel-reorder. Mention it in -funit-at-a-time documentation. cp/: * parser.c: Include "cgraph.h". (cp_parser_asm_definition): Call cgraph_add_asm_node rather than assemble_asm. From-SVN: r109811
2006-01-17 08:04:20 +01:00
}
cgraph_process_new_functions ();
cgraph_state = CGRAPH_STATE_FINISHED;
[multiple changes] 2005-03-31 Jan Hubicka <jh@suse.cz> 2004-11-02 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_node_name): New function. (dump_cgraph_varpool_node): New function. (dump_varpool): New function. * cgraphunit.c (cgraph_optimize): Dump varpool. 2004-10-16 Jan Hubicka <jh@suse.cz> * cgraph.c (decide_is_variable_needed): New function. (cgraph_varpool_finalize_decl): Use it. * cgraphunit.c (cgraph_optimize): Assemble_pending_decls when not doing unit-at-a-time. * final.c (output_addr_const): Do not call mark_referenced. * passes.c (rest_of_decl_compilation): ifdef out DECL_RTL_SET_P hack; always go via cgraph. * toplev.c (wrapup_global_declarations): Kill non-unit-at-a-time code. (check_global_declarations): Ifdef out code clearing DECL_RTL. * tree-optimize.c (execute_inline): Mark functions called. * i386.c (output_pic_addr_const): Do not call mark_decl_referenced. 2004-10-11 Jan Hubicka <jh@suse.cz> * cgraph.c (cgraph_varpool_first_unanalyzed_node): New global voriable (cgraph_varpool_last_needed_node): New static variable. (enqueue_needed_varpool_node): Break out from ...; add items to the end of queue; update first pointers. (cgraph_varpool_mark_needed_node): ... here. (cgraph_varpool_finalize_decl): Use enqueue_needed_varpool_node. (cgraph_varpool_assemble_pending_decls): Move to cgraphunit.c * cgraph.h (cgraph_varpool_node): Add analyzed field. (cgraph_varpool_first_unanalyzed_node): Declare. * cgraphunit.c: Include output.h. (cgraph_varpool_analyze_pending_decls): New function. (cgraph_varpool_assemble_pending_decls): Move from cgraph.c; bail out for errors, analyze pending decls. (cgraph_finalize_compilation_unit): Only analyze decls. (cgraph_optimize): Assemble the decls after expanding. From-SVN: r97287
2005-03-31 00:28:02 +02:00
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "\nFinal ");
dump_cgraph (cgraph_dump_file);
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
#ifdef ENABLE_CHECKING
verify_cgraph ();
/* Double check that all inline clones are gone and that all
function bodies have been released from memory. */
cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code. (build_cgraph_edges): Likewise. * cgraph.c (cgraph_node): Do not update assembler hash. (cgraph_remove_node): Drop non-unit-at-a-time code. * tree-pass.h (pass_O0_always_inline): Remove. * ipa-reference.c (gate_reference): Remove unit-at-a-time check. * toplev.c (process_options): Flag unit-at-a-time does not imply no section anchors. * cgraphunit.c: Update comments. (decide_is_function_needed): Drop non-unit-at-a-time mode. (cgraph_assemble_pending_functions): Remove. (cgraph_reset_node): Drop non-unit-at-a-time code. (cgraph_finalize_function): Likewise. (cgraph_analyze_function): Likewise. (cgraph_finalize_compilation_unit): Likewise. (cgraph_expand_function): Likewise. (cgraph_optimize): Likesise. (save_inline_function_body): Likewise. * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check. * tree-ssa-alias.c (maybe_be_aliased): Likewise. * ipa-inline.c: Update comments. (enum inlining_mode): remove INLINE_SPEED. (cgraph_clone_inlined_nodes): Drop unit-at-a-time check. (cgraph_mark_inline_edge): Likewise. (try_inline): Likewise. (cgraph_decide_inlining_incrementally): Likewise. (cgraph_gate_inlining): Remove. (cgraph_early_inlining): Remove flag_unit_at_a_time checks. (cgraph_gate_early_inlining): Likewise. (gate_inline_passes): Remove. (pass_inline_parameters, pass_ipa_inline): Remove gates. (cgraph_gate_O0_always_inline, cgraph_O0_always_inline, pass_O0_always_inline): Remove. * c-pch.c (c_pch_matching): Remove -funit-at-a-time. * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check. * opts.c (no_unit_at_a_time_default): Remove. (decode_options): Remove flag_unit_at_a_time reset and warning. * opts.h (no_unit_at_a_time_default): Remove. * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword early in GNU dialect. (merge_decls): Update comment; drop unit-at-a-time check. (finish_decl): Likewise. (grok_declaration): Remove flag_inline_trees code. (finish_functions): Return on function returning non-void on all statics. * ipa-tye-escape.c (gate_type_escape_vars): Remove. * cfgexpand.c (expand_one_static_var): Remove. (expand_one_var): Remove expand_one_static_var call. (expand_used_vars_for_block): Remove flag_unit_a_time check. * c-opts.c (c_common_post_options): Remove flag_inline_trees code and flag_unit_at_a-time compatibility checks. * varasm.c (assemble_alias): Remove flag_unit_at_a_time check. * tree-inline.c (flag_inline_trees): Remove. (inlinable_function_p): Don't check it. (expand_call_inline): Remove non-unit-at-a-time code. * tree-inline.h (flag_inline_trees): Remove. * tree-optimize.c (execute_early_local_optimizations): Remove unit-at-a-time checks. (tree_rest_of_compilation): Likewise. * combine.c (setup_incoming_promotions): Likewise. * tree-profile.c (tree_gen_ic_func_profiler): Likewise. * tree-ssa-structalias.c (delete_points_to_sets): Likewise. * passes.c (pass_inline_parameters): Update comments; remove O0_alwaysinline pass. (execute_one_ipa_transform_pass): Do not reset in_gimple_form. (execute_one_pass): Likewise. * i386.c (ix86_function_regparm): Remove unit-at-a-time check. (ix86_function_sseregparm): Likewise. * arm.c (arm_function_in_section_p): Likewise. * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise. * varpool.c: Update comments. (decide_is_variable_needed): Remove unit-at-a-time checks. (varpool_finalize_decl): Likewise. * ada/utils.c (end_subprog_body): Remove inline trees check. * ada/misc.c (gnat_post_options): Do not set flag_inline_trees. * fortran/options.c (gfc_post_options): Remove flag_unline_trees code. * gcc.dg/winline-4.c: Remove. * gcc.dg/pch/valid-3.hs: Remove. * gcc.dg/pch/valid-3.c: Remove. * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning * g++.old-deja/g++.jason/report.C: Likewise. * testsuite/g++.dg/warn/pr23075.C: We get returning void warning instead of control flow warning. * cp/decl.c (duplicate_decls): Update comment and unit-at-a-time. (grogfndecl): Drop flag_inline_trees code. * cp/pt.c (instantiate_decl): Drop flag_iline_trees code. * cp/lex.c (cxx_init): Do not set unit-at-a-time. * java/decl.c: Include cgraph.h (end_java_method): Remove non-unit-at-a-time code. (java_mark_decl_local): Likewise; sanity check that we don't touch finalized nodes. From-SVN: r138140
2008-07-25 15:11:32 +02:00
if (!(sorrycount || errorcount))
{
struct cgraph_node *node;
bool error_found = false;
for (node = cgraph_nodes; node; node = node->next)
if (node->analyzed
&& (node->global.inlined_to
|| gimple_has_body_p (node->decl)))
{
error_found = true;
dump_cgraph_node (stderr, node);
2006-05-19 00:16:23 +02:00
}
if (error_found)
internal_error ("nodes with unreleased memory found");
}
cgraph.c: Add overall comment. * cgraph.c: Add overall comment. (cgraph_inline_hash): New global variable. (cgraph_create_node): Break out from ... (cgraph_node): ... here. (cgraph_edge): New function. (cgraph_create_edge): New CALL_EXPR argument; some sanity checking. (cgraph_remove_edge): Accept edge, intead of source and destination. (cgraph_redirect_edge_callee): New. (cgraph_remove_node): Update all new datastructures. (cgraph_record_call, cgraph_remove_call): Kill. (dump_cgraph_node): Break out from ... ; dump new datastructures. (dump_cgraph): ... here. (cgraph_function_possibly_inlined_p): Use new hashtable. (cgraph_clone_edge, cgraph_clone_node): New. * cgraph.h: Include hashtab.h (struct cgraph_global_info): Kill cloned_times, inline_once, will_be_output fields, add inlined_to pointer. (cgraph_node): Add pointer to next_clone. (cgraph_remove_edge, cgraph_create_edge): Update prototype. (cgraph_remove_call, cgraph_record_call): Kill. (cgraph_inline_hash): Declare. (dump_cgraph_node, cgraph_edge, cg4raph_clone_edge, cgraph_clone_node, cgraph_redirect_edge_callee): Declare. (cgraph_create_edges, cgraph_inline_p): Update prorotype. (cgraph_preserve_function_body_p, verify_cgraph, verify_cgraph_node, cgraph_mark_inline_edge, cgraph_clone_inlined_nodes): Declare. * cgraphunit.c: Add overall comment. (cgraph_optimize_function): Kill. (cgraph_assemble_pending_functions): Do not assemble inline clones. (cgraph_finalize_function): Update call of cgraph_remove_node (record_call_1): Record call sites. (cgraph_create_edges): Accept node instead of decl argument. (error_found): New static variable. (verify_cgraph_node_1, verify_cgraph_node, verify_cgraph): New functions. (cgraph_analyze_function): Update for new datastructures. (cgraph_finalize_compilation_unit): Plug memory leak. (cgraph_optimize_function): Kill. (cgraph_expand_function): Do not use cgraph_optimize_function. (INLINED_TIMES, SET_INLINED_TIMES, cgraph_inlined_into, cgraph_inlined_callees): Kill. (cgraph_remove_unreachable_nodes): Verify cgraph; update handling of clones. (estimate_growth): Simplify. (cgraph_clone_inlined_nodes): New function. (cgraph_mark_inline_edge): Re-implement. (cgraph_mark_inline): Likewise. (cgraph_check_inline_limits): Simplify. (cgraph_recursive_inlining_p): New. (update_callee_keys): Break out from ... (cgraph_decide_inlining_of_small_functions): ... here; simplify. (cgraph_decide_inlining, cgraph_decide_inlining_incrementally): Likewise. (cgraph_expand_all_functions): Remove inline clones from the ordered list. (cgraph_preserve_function_body_p): New predicate. (cgraph_optimize): Verify cgraph. * function.h (struct function): Add fields saved_tree/saved_args. * timevar.def (TV_CGRAPH_VERIFY): Use verifier. * toplev.c (rest_of_compilation): Do not free cfun. * tree-inline.c: Include function.h (struct inline_data): Add saving_p field; replace decl/current_decl by node/current_node. (insert_decl_map): New function. (copy_body_r): Handle saving; update cgraph datastructure. (copy_body): Handle recursive inlining. (initialize_inlined_parameters): Likewise. (expand_call_inline): Propagate node attributes; update cgraph. (optimize_inline_calls): Verify that datastructure still match. (save_body): New function. * tree-inline.h (save_body): New. * tree-optimize.c (tree_rest_of_compilation): preserve function body; do inlining. * langhooks-def.c (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): New. * langhooks.c (lang_hooks): Add update_decl_after_saving. * cp-lang. (LANG_HOOKS_UPDATE_DECL_AFTER_SAVING): Define. * cp-tree.h (cp_update_decl_after_saving): Declare. * tree.c (cp_update_decl_after_saving): Define. * Make-lang.in (com.o): Add dependnecy on function.h * com.c: Include function.h (finish_function): Clear DECL_STRUCT_FUNCTION. * utils.c: Include function.h (end_subprog_body): Clear DECL_STRUCT_FUNCTION. From-SVN: r80334
2004-04-02 01:28:15 +02:00
#endif
}
[multiple changes] 2009-09-01 Diego Novillo <dnovillo@google.com> * c-lang.c (lang_hooks): Remove const qualifier. java/ChangeLog * lang.c (lang_hooks): Remove const qualifier. objc/ChangeLog * objc-lang.c (lang_hooks): Remove const qualifier. objcp/ChangeLog * objcp-lang.c (lang_hooks): Remove const qualifier. ada/ChangeLog * gcc-interface/misc.c (lang_hooks): Remove const qualifier. fortran/ChangeLog * f95-lang.c (lang_hooks): Remove const qualifier. cp/ChangeLog * cp-lang.c (lang_hooks): Remove const qualifier. 2009-09-01 Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_node_for_decl): New. * cgraph.h (cgraph_node_for_decl): Declare. * tree.c (host_integerp): Return 0 if T is NULL. 2009-09-01 Diego Novillo <dnovillo@google.com> * tree.h (struct alias_pair): Move from varasm.c. (alias_pairs): Likewise. (TYPE_MAXVAL): Define. (TYPE_MINVAL): Define. (iterative_hash_host_wide_int): Declare. (remove_unreachable_alias_pairs): Declare. * tree-pass.h (pass_ipa_free_lang_data): Declare. * diagnostic.c (default_diagnostic_starter): Make extern. (default_diagnostic_finalizer): Make extern. * diagnostic.h (default_diagnostic_starter): Declare. (default_diagnostic_finalizer): Declare. (default_tree_printer): Declare. * toplev.c (default_tree_printer): Make extern. 2009-09-01 Richard Guenther <rguenther@suse.de> Diego Novillo <dnovillo@google.com> * cgraph.c (cgraph_add_new_function): Remove gimplification. * cgraphunit.c (cgraph_expand_function): Do not emit associated thunks from here. (cgraph_emit_thunks): New. (cgraph_optimize): Call it. Return if any IPA pass finds an error. * varasm.c (finish_aliases_1): Ignore errorneous aliases used by thunks. 2009-09-01 Simon Baldwin <simonb@google.com> Rafael Espindola <espindola@google.com> Richard Guenther <rguenther@suse.de> Doug Kwan <dougkwan@google.com> Diego Novillo <dnovillo@google.com> * tree.c: Include tree-pass.h, langhooks-def.h, diagnostic.h, cgraph.h, timevar.h, except.h and debug.h. (free_lang_data_in_type): New. (need_assembler_name_p): New. (free_lang_data_in_block): New. (free_lang_data_in_decl): New. (struct free_lang_data_d): New. (add_tree_to_fld_list): New. (find_decls_types_r): New. (get_eh_types_for_runtime): New. (find_decls_types_in_eh_region): New. (find_decls_types_in_node): New. (find_decls_types_in_var): New. (free_lang_data_in_cgraph): New. (free_lang_data): New. (gate_free_lang_data): New. (pass_ipa_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * timevar.def (TV_IPA_FREE_LANG_DATA): Define. * langhooks.h (struct lang_hooks): Add field free_lang_data. (lang_hooks): Remove const qualifier. * ipa.c (cgraph_remove_unreachable_nodes): Call remove_unreachable_alias_pairs. * except.c (add_type_for_runtime): Check if TYPE has already been converted. (lookup_type_for_runtime): Likewise. (check_handled): Handle converted types. * varasm.c (remove_unreachable_alias_pairs): New. * gimple.c: Include demangle.h. (gimple_decl_printable_name): New. (gimple_fold_obj_type_ref): New. * gimple.h (gimple_decl_printable_name): Declare. (gimple_fold_obj_type_ref): Declare. * passes.c (init_optimization_passes): Add pass pass_ipa_free_lang_data. * langhooks-def.h (LANG_HOOKS_FREE_LANG_DATA): Define. (LANG_HOOKS_INITIALIZER): Add LANG_HOOKS_FREE_LANG_DATA. testsuite/ChangeLog 2009-09-01 Diego Novillo <dnovillo@google.com> * gcc.dg/gomp/combined-1.c: Adjust expected pattern. * g++.dg/tree-prof/inline_mismatch_args.C: Likewise. * g++.dg/warn/unit-1.C: Likewise. * g++.dg/ipa/iinline-1.C: Likewise. * g++.dg/template/cond2.C: Adjust expected line location for the error. * g++.dg/template/pr35240.C: Likewise. cp/ChangeLog 2009-09-01 Doug Kwan <dougkwan@google.com> * tree.c (cp_fix_function_decl_p): New. (cp_free_lang_data): New. 2009-09-01 Diego Novillo <dnovillo@google.com> * Make-lang.in (decl2.o): Add dependency on $(POINTER_SET_H). * decl2.c: Include pointer-set.h. (collect_candidates_for_java_method_aliases): New. (cp_write_global_declarations): Call it. Add local variable CANDIDATES. If set, call build_java_method_aliases. (build_java_method_aliases): Add argument CANDIDATES. Use it to determine if FNDECL should get a hidden alias. * cp-objcp-common.h (LANG_HOOKS_FREE_LANG_DATA): Define. * cp-tree.h (cp_free_lang_data): Declare. 2009-09-03 Richard Guenther <rguenther@suse.de> * method.c (use_thunk): Use cgraph_finalize_function to hand off thunks to the cgraph. * semantics.c (emit_associated_thunks): Do not emit thunks for really extern functions. From-SVN: r151360
2009-09-03 06:07:12 +02:00
/* Generate and emit a static constructor or destructor. WHICH must
be one of 'I' (for a constructor) or 'D' (for a destructor). BODY
is a STATEMENT_LIST containing GENERIC statements. PRIORITY is the
cgraph.c: Fix typos in comments. gcc/ * cgraph.c: Fix typos in comments. (cgraph_availability_names): Fix string typo. * fold-const.c: Fix typos in comments. (fold_binary): Fix typo in warning. * genautomata.c: Fix typos in comments. (check_presence_pattern_sets): Fix typo in local variable. (output_description): Fix typo in output. * ggc-zone.c (ggc_pch_finish): Fix typo in error message. * hwint.h: Likewise. * matrix-reorg.c (check_allocation_function): Likewise. * omega.c (smooth_weird_equations): Likewise. * auto-inc-dec.c: Fix typos in comments. * bb-reorder.c: Likewise. * builtins.c: Likewise. * c-common.c: Likewise. * c-cppbuiltin.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfglayout.c: Likewise. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * function.c: Likewise. * function.h: Likewise. * gcc.c: Likewise. * gcov-io.c: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattrtab.c: Likewise. * ggc-page.c: Likewise. * gimplify.c: Likewise. * gthr-lynx.h: Likewise. * haifa-sched.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa.c: Likewise. * loop-doloop.c: Likewise. * mips-tfile.c: Likewise. * mkmap-flat.awk: Likewise. * mkmap-symver.awk: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts.c: Likewise. * passes.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * pretty-print.h: Likewise. * profile.c: Likewise. * protoize.c: Likewise. * ra-conflict.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * regclass.c: Likewise. * regs.h: Likewise. * reload.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * scan.h: Likewise. * sched-rgn.c: Likewise. * see.c: Likewise. * stmt.c: Likewise. * target.h: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-analyze.c: Likewise. * tree-vect-transform.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vn.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * unwind-dw2-fde.c: Likewise. * unwind.inc: Likewise. * value-prof.c: Likewise. * vmsdbgout.c: Likewise. From-SVN: r136425
2008-06-06 07:42:00 +02:00
initialization priority for this constructor or destructor. */
void
cgraph_build_static_cdtor (char which, tree body, int priority)
{
static int counter = 0;
char which_buf[16];
tree decl, name, resdecl;
/* The priority is encoded in the constructor or destructor name.
collect2 will sort the names and arrange that they are called at
program startup. */
sprintf (which_buf, "%c_%.5d_%d", which, priority, counter++);
name = get_file_function_name (which_buf);
java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt. gcc/java/ * java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt. * expr.c (force_evaluation_order): Same. * typeck.c: Add location to build_decl or PUSH_FIELD calls. * class.c: Same. * decl.c: Same. * jcf-parse.c: Same. * constants.c: Same. * resource.c: Same. * except.c: Same. * builtins.c: Same. * expr.c: Same. * java-tree.h (PUSH_FIELD): Add location field. gcc/objc/ * objc-act.c (finish_var_decl): Pass location to finish_decl. (objc_get_parm_info): Same. (get_super_receiver): Same. * objc-act.c (objc_build_component_ref): Pass location to build_compound_ref. (build_module_initializer_routine): Pass location to c_end_compound_stmt. (objc_generate_static_init_call): Pass location to build_stmt. (build_typed_selector_reference): New location argument. (build_selector_reference): Same. (objc_substitute_decl): Pass location to build_array_ref. (next_sjlj_build_try_catch_finally): Pass location to build_stmt. (objc_begin_catch_clause): Same. (objc_finish_try_stmt): Same. (objc_finish_catch_clause): Pass location to c_end_compound_stmt. (objc_build_throw_stmt): New argument. (generate_shared_structures): Pass location to build_c_cast. (objc_build_message_expr): Use local location. (objc_finish_message_expr): Use input_location. (build_objc_method_call): New argument. (objc_build_selector_expr): Same. (get_super_receiver): Pass location to build_c_cast, build_modify_expr, build_compound_expr. * objc-act.c: Add location to all calls to start_struct, build_decl, finish_struct. gcc/ * tree-pretty-print.c (dump_generic_node): Dump column numbers. * gimple-pretty-print.c (dump_gimple_stmt): Same. * gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs created. * c-parser.c (c_parser_binary_expression): Use current column while building binary operations. * common.opt (fshow-column): Enable by default. * tree-vrp.c (check_array_ref): Use warning_at. (check_array_bounds): Use location from call back if expr has no location. * tree.h: Add location argument to maybe_fold_*. * tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*. (maybe_fold_offset_to_array_ref): Add location argument and use it. (maybe_fold_offset_to_component_ref): Same. (maybe_fold_offset_to_reference): Same. (maybe_fold_offset_to_address): Same. (maybe_fold_stmt_indirect): Same. (maybe_fold_stmt_addition): Same. (fold_stmt_r): Pass location to maybe_fold_*. (fold_gimple_assign): Same. * c-tree.h: Add location argument to finish_decl, default_function_array_conversion, store_init_value. * c-decl.c (define_label): Use error_at. (c_make_fname_decl): Pass location to finish_decl. (finish_decl): New location argument. (build_compound_literal): Pass location to store_init_value. (grokdeclarator): Pass location to finish_decl. (grokfield): Same. * c-typeck.c (array_to_pointer_conversion): New location argument. (function_to_pointer_conversion): Same. (default_function_array_conversion): Same. (parser_build_unary_op): Pass location to overflow_warning. (parser_build_binary_op): Same. Use warning_at. (build_unary_op): Pass location to array_to_pointer_conversion. (build_c_cast): Pass location to digest_init. (build_modify_expr): New location argument. (convert_for_assignment): Same. (store_init_value): Same. (digest_init): Same. (output_init_element): Pass location to digest_init and array_to_pointer_conversion. (c_finish_return): Pass location to convert_for_assignment. * gimplify.c (gimplify_conversion): Pass location to maybe_fold_offset_to_address. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location to maybe_fold_stmt_addition. * c-omp.c (c_finish_omp_atomic): Pass new location to build_modify_expr. (c_finish_omp_for): Same. * c-common.c (overflow_warning): New argument. * c-common.h: New argument to build_modify_expr, overflow_warning. * c-parser.c (c_parser_declaration_or_fndef): Pass location to finish_decl. (c_parser_initializer): Pass location to default_function_array_conversion. (c_parser_initelt): Same. (c_parser_initval): Same. (c_parser_asm_operands): Same. (c_parser_expr_no_commas): Same. Pass location to build_modify_expr. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Add location info to stack. Use it. (c_parser_unary_expression): Pass location to default_function_array_conversion, parser_build_unary_op, build_indirect_ref, c_parser_postfix_expression_after_primary. (c_parser_postfix_expression_after_primary): New location argument. Use it. (c_parser_expression_conv): Pass location to default_function_array_conversion. (c_parser_expr_list): Same. (c_parser_omp_atomic): Same. (c_parser_omp_for_loop): Same. * c-tree.h: (struct c_declarator): Add comment to id_loc. (build_array_declarator): New argument. * c-decl.c (build_array_declarator): Add location argument. (grokdeclarator): Set id_loc for cdk_array. * c-parser.c (c_parser_direct_declarator_inner): Pass location to build_array_declarator. * tree.c (build_omp_clause): Add location argument. * tree.h (OMP_CLAUSE_HAS_LOCATION): New macro. (OMP_CLAUSE_LOCATION): New macro. (struct tree_omp_clause): Add location field. (build_omp_clause): Add argument. * testsuite/gcc.dg/gomp/for-1.c: Fix column. * cp/pt.c (tsubst_omp_for_iterator): Pass location to build_omp_clause. * cp/parser.c (cp_parser_omp_var_list_no_open): Same. (cp_parser_omp_clause_collapse): Same. (cp_parser_omp_clause_default): Same. (cp_parser_omp_clause_if): Same. (cp_parser_omp_clause_nowait): Same. (cp_parser_omp_clause_num_threads): Same. (cp_parser_omp_clause_ordered): Same. (cp_parser_omp_clause_schedule): Same. (cp_parser_omp_clause_untied): Same. (cp_parser_omp_for_loop): Same. (cp_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (c_start_case): Add location argument. (c_process_expr_stmt): Same. (c_finish_goto_*): Same. * tree-parloops.c (initialize_reductions): Pass location to build_omp_clause. (create_parallel_loop): Same. * fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same. (gfc_trans_omp_reduction_list): Same. (gfc_trans_omp_clauses): Same. (gfc_trans_omp_do): Same. * c-typeck.c (c_finish_goto_label): Same. (c_finish_goto_ptr): New location argument. (c_start_case): Same. (emit_side_effect_warnings): Same. (c_process_expr_stmt): Same. (c_finish_stmt_expr): Same. (c_finish_omp_clauses): Use error_at instead of error. * gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to build_omp_clause. * c-omp.c (c_split_parallel_clauses): New location argument. * tree-nested.c (convert_nonlocal_reference_stmt): Pass location to build_omp_clause. (convert_local_reference_stmt): Same. (convert_gimple_call): Same. * c-common.h (c_split_parallel_clauses): New argument. * c-parser.c (c_parser_statement_after_labels): Pass location to c_finish_goto_label. (c_parser_switch_statement): Pass location to c_start_case. (c_parser_for_statement): Pass location to c_finish_expr_stmt, and c_process_expr_stmt. (c_parser_omp_variable_list): Add location argument. (c_parser_omp_clause_collapse): Pass location to build_omp_clause. (c_parser_omp_clause_default): Same. (c_parser_omp_clause_if): Same. (c_parser_omp_clause_num_threads): Same. (-c_parser_omp_clause_ordered): Same. (c_parser_omp_clause_reduction): Pass location to c_parser_omp_variable_list. (c_parser_omp_clause_schedule): Pass location to build_omp_clause. (c_parser_omp_clause_untied): Same. (c_parser_omp_for_loop): Pass location to c_process_expr_stmt. (c_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (check_for_loop_decls, undeclared_variable, build_component_ref, build_array_ref, build_external_ref, c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op, build_conditional_expr, build_compound_expr, c_cast_expr, build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr, c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New argument. * c-semantics.c (build_stmt): Same. (build_case_label): Same. * c-decl.c (c_finish_incomplete_decl): Pass location on down. (undeclared_variable): New argument. (make_label): Same. (lookup_label): Pass location on down. (define_label): Same. (finish_decl): Same. (build_compound_literal): Same. (finish_struct): Same. (finish_function): Do not set location here. (check_for_loop_decls): New argument. * tree.c (save_expr): Set location. (build_empty_stmt): New argument. * tree.h (build_empty_stmt): New argument to build_empty_stmt. (CAN_HAVE_LOCATION_P): Make sure we have a non empty node. * builtins.c (gimplify_va_arg_expr): Use locations. (expand_builtin_sync_operation): Same. * c-typeck.c (build_component_ref): New argument. (build_array_ref): Same. (build_external_ref): Same. (c_expr_sizeof_expr): Same. (c_expr_sizeof_type): Same. (parser_build_unary_op): Same. (build_conditional_expr): Same. (build_compound_expr): Pass location on down. (build_compound_expr): New argument. (build_c_cast): Same. (c_cast_expr): Same. (build_asm_expr): Same. (c_finish_return): Same. (c_process_expr_stmt): Pass location on down. (c_finish_stmt_expr): New argument. (push_clenaup): Same. (c_finish_omp_parallel): Same. (c_finish_omp_task): Same. * gimplify.c (gimplify_call_expr): Pass location on down. * c-omp.c (c_finish_omp_master): New argument. (c_finish_omp_critical): Same. (c_finish_omp_ordered): Same. (c_finish_omp_barrier): Same. (-c_finish_omp_taskwait): Same. (c_finish_omp_atomic): Same. (c_finish_omp_flush): Same. * tree-inline.c (copy_tree_body_r): Pass location on down. (inline_forbidden_p): Remove use of input_location. * c-gimplify.c (c_build_bind_expr): New argument. * c-common.c (c_common_truthvalue_conversion): Pass location on down. (c_sizeof_or_alignof_type): New argument. (c_alignof_expr): Same. (build_va_arg): Same. (c_add_case_label): Same. * c-common.h (c_sizeof_or_alignof_type, c_alignof_expr, c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label, c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses): New argument. * stub-objc.c (objc_build_selector_expr): Same. (objc_build_throw_stmt): Same. * c-parser.c (c_parser_declaration_or_fndef): Pass location on down. (c_parser_initelt): Same. (c_parser_compound_statement): Same. (c_parser_compound_statement_nostart): Same. (c_parser_label): Same. (c_parser_statement_after_labels): Same. (c_parser_if_body): Same. (c_parser_else_body): Same. (c_parser_if_statement): Same. (c_parser_switch_statement): Same. (c_parser_while_statement): Same. (c_parser_do_statement): Same. (c_parser_for_statement): Same. (c_parser_asm_statement): Same. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Same. (c_parser_cast_expression): Same. (c_parser_unary_expression): Same. (c_parser_sizeof_expression): Same. (c_parser_alignof_expression): Same. (c_parser_postfix_expression): Same. (c_parser_expression): Same. (c_parser_objc_receiver): Same. (c_parser_omp_variable_list): Same. (c_parser_omp_structured_block): Same. (c_parser_omp_atomic): New argument. (c_parser_omp_barrier): Same. (c_parser_omp_critical): Same. (c_parser_omp_flush): Pass location on down. (c_parser_omp_for_loop): New argument. (c_parser_omp_for): Same. (c_parser_omp_master): Same. (c_parser_omp_ordered): Same. (c_parser_omp_sections_scope): Same. (c_parser_omp_sections): Same. (c_parser_omp_parallel): Same. (c_parser_omp_single): Same. (c_parser_omp_task): Same. (c_parser_omp_taskwait): Pass location on down. (c_parser_omp_construct): Same. (c_parser_omp_threadprivate): Same. * dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h, builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c, tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c, c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c, c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c, emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c, rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h, tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c, config/i386/i386.c, stmt.c: Add location argument to the following function definitions and/or function calls: build_decl, objcp_start_struct, objcp_finish_struct, start_struct, finish_struct, PUSH_FIELD, create_artificial_label, cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl, build_compound_literal, parser_xref_tag, resolve_overloaded_builtin, do_case, c_finish_bc_stmt, build_compound_literal, build_function_call. * c-decl.c (build_compound_literal): Add location argument. Make all diagnostic calls use location. (start_struct): Same. (finish_struct): Same. (start_enum): Same. (build_enumerator): Same. (start_function): Same. (grokdeclarator): Make all diagnostic calls use location. (store_parm_decls_oldstyle): Same. * c-typeck.c (build_function_call): Add location argument. Make all diagnostic calls use location. (do_case): Same. (c_finish_bc_stmt): Same. * tree-nested.c (get_trampoline_type): Add argument. Pass location to build_decl. (lookup_tramp_for_decl): Pass location to get_trampoline_type. * rtl.h (RTL_LOCATION): New. * c-common.c (c_add_case_label): Add location argument. Make all diagnostic calls use location. * c-common.h: Add location argument to make_fname_decl, do_case, c_add_case_label, build_function_call, resolve_overloaded_builtin. * c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc. Set it appropriately for every case. Pass enum_loc to start_enum call. Pass value_loc first to build_enumerator. Pass enum_loc to parser_xref_tag. (c_parser_struct_or_union_specifier): Save location. Use it for start_struct, finish_struct, and parser_xref_tag. gcc/testsuite/ * gcc.dg/old-style-prom-3.c: Add column info. * gcc.dg/overflow-warn-1.c * gcc.dg/gomp/pr27415.c * gcc.dg/gomp/for-1.c: Same. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/c99-tag-3.c: Same. * gcc.dg/Wredundant-decls-2.c: Same. * gcc.dg/func-ptr-conv-1.c: Same. * gcc.dg/asm-wide-1.c: Same. * gcc.dg/nofixed-point-2.c: Same. * gcc.dg/cpp/line3.c: Same. * gcc.dg/array-10.c: Same. * gcc.dg/c99-vla-jump-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/Wshadow-3.c: Same. * gcc.dg/c90-const-expr-8.c: Same. * gcc.dg/label-decl-2.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/c90-const-expr-5.c: Same. * gcc.dg/builtins-30.c: Same. * gcc.dg/Warray-bounds.c: Same. * gcc.dg/Wcxx-compat-2.c: Same. * gcc.dg/tree-ssa/col-1.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/cast-function-1.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/vla-8.c: Same. * gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct line. * gcc.dg/label-decl-2.c: Move label diagnostic to correct line. * gcc.dg/old-style-prom-3.c: Check for error on the correct line. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/builtins-30.c: Same. Test for columns. gcc/objcp/ * objcp-decl.h (c_end_compound_stmt): New argument. * objcp-decl.c (objcp_start_struct): Add argument. (objcp_finish_struct): Same. gcc/cp/ * typeck.c (cp_build_binary_op): Pass location to overflow_warning. (build_modify_expr): New arg. * semantics.c (finish_unary_op_expr): Pass location to overflow_warning. (handle_omp_for_class_iterator): Pass location to build_modify_expr. * typeck.c (cxx_sizeof_or_alignof_type): Pass location to c_sizeof_or_alignof_type. (build_array_ref): New argument. (build_compound_expr): Same. (build_const_cast): Same. (build_ptrmemfunc): Pass location to build_c_cast. * init.c (avoid_placement_new_aliasing): Pass location to build_stmt. (build_vec_delete_1): Pass location to cp_build_modify_expr, build_compound_expr. * class.c (build_vtbl_ref_1): Pass location to build_array_ref. * decl.c (poplevel): Pass location to c_build_bind_expr. (finish_case_label): Pass location to build_case_label. (finish_constructor_body): Same. (finish_destructor_body): Pass location to build_stmt. (cxx_maybe_build_cleanup): Same, but to build_compound_expr. * call.c (build_new_op): Pass location to build_array_ref. (build_x_va_arg): Pass location to build_va_arg. * except.c (expand_end_catch_block): Pass location to build_stmt. * cp-tree.h (build_array_ref): New argument. (build_compound_expr): Same. (build_c_cast): Same. * cp-gimplify.c (gimplify_if_stmt): Pass location on down. (gimplify_switch_stmt): Same. * typeck2.c (split_nonconstant_init_1): Same. * pt.c (tsubst_copy): Same. * semantics.c (add_decl_expr): Same. (do_poplevel): Same. (push_cleanup): Same. (finish_goto_stmt): Same. (finish_expr_stmt): Same. (begin_if_stmt): Same. (begin_while_stmt): Same. (begin_do_stmt): Same. (finish_return_stmt): Same. (begin_for_stmt): Same. (finish_break_stmt): Same. (finish_continue_stmt): Same. (begin_switch_stmt): Same. (begin_try_block): Same. (begin_handler): Same. (finish_asm_stmt): Same. (finish_label_stmt): Same. (finish_stmt_expr_expr): Same. (finalize_nrv_r): Same. (finish_omp_atomic): Same. * name-lookup.c (do_using_directive): Same. * decl2.c (grok_array_decl): Same. * parser.c (cp_parser_cast_expression): Same. (cp_parser_selection_statement): Same. (cp_parser_implicitly_scoped_statement): Same. (cp_parser_objc_selector_expression): Same. (cp_parser_objc_synchronized_statement): Same. (cp_parser_objc_throw_statement): Same. (cp_parser_omp_critical): Same. (cp_parser_omp_master): Same. * typeck.c (build_function_call): Add location argument. * init.c: Add location argument to all build_decl calls. * class.c: Same. * method.c: Same. * rtti.c: Same. * tree.c: Same. * pt.c: Same. * semantics.c: Same. * lex.c: Same. * decl2.c: Same. * cp-gimplify.c: Same. * decl.c: Same. (cp_make_fname_decl): Add location argument. Pass location ot build_decl. (finish_case_label): Same. * cp-tree.h (finish_case_label): Add location argument. * parser.c (cp_parser_label_for_labeled_statement): Pass location to finish_case_label. gcc/fortran/ * trans-array.c (gfc_trans_allocate_array_storage): Pass location on down. (gfc_trans_array_constructor_value): Same. (gfc_trans_scalarized_loop_end): Same. (gfc_conv_ss_startstride): Same. (gfc_trans_g77_array): Same. (gfc_trans_dummy_array_bias): Same. (gfc_conv_array_parameter): Same. (structure_alloc_comps): Same. * trans-expr.c (gfc_conv_function_call): Same. (fill_with_spaces): Same. (gfc_trans_string_copy): Same. (gfc_trans_scalar_assign): Same. * trans-stmt.c (gfc_trans_goto): Same. (gfc_trans_if_1): Same. (gfc_trans_simple_do): Same. (gfc_trans_do): Same. (gfc_trans_do_while): Same. (gfc_trans_logical_select): Same. (gfc_trans_select): Same. (gfc_trans_forall_loop): Same. (gfc_trans_nested_forall_loop): Same. (generate_loop_for_temp_to_lhs): Same. (generate_loop_for_rhs_to_temp): Same. (gfc_trans_forall_1): Same. (gfc_trans_where_assign): Same. (gfc_trans_where_3): Same. (gfc_trans_allocate): Same. * trans.c (gfc_finish_block): Same. (gfc_trans_runtime_check): Same. (gfc_call_malloc): Same. (gfc_allocate_with_status): Same. (gfc_call_free): Same. (gfc_deallocate_with_status): Same. (gfc_call_realloc): Same. (gfc_trans_code): Same. * trans-decl.c (gfc_init_default_dt): Same. (gfc_generate_constructors): Same. * trans-io.c (gfc_trans_io_runtime_check): Same. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same. (gfc_conv_intrinsic_fdate): Same. (gfc_conv_intrinsic_ttynam): Same. (gfc_conv_intrinsic_minmax): Same. (gfc_conv_intrinsic_minmax_char): Same. (gfc_conv_intrinsic_anyall): Same. (gfc_conv_intrinsic_count): Same. (gfc_conv_intrinsic_arith): Same. (gfc_conv_intrinsic_minmaxloc): Same. (gfc_conv_intrinsic_minmaxval): Same. (gfc_conv_intrinsic_rrspacing): Same. (gfc_conv_intrinsic_array_transfer): Same. (gfc_conv_intrinsic_trim): Same. (gfc_conv_intrinsic_repeat): Same. From-SVN: r148442
2009-06-13 00:06:47 +02:00
decl = build_decl (input_location, FUNCTION_DECL, name,
build_function_type (void_type_node, void_list_node));
current_function_decl = decl;
java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt. gcc/java/ * java-gimplify.c (java_gimplify_block): New argument to build_empty_stmt. * expr.c (force_evaluation_order): Same. * typeck.c: Add location to build_decl or PUSH_FIELD calls. * class.c: Same. * decl.c: Same. * jcf-parse.c: Same. * constants.c: Same. * resource.c: Same. * except.c: Same. * builtins.c: Same. * expr.c: Same. * java-tree.h (PUSH_FIELD): Add location field. gcc/objc/ * objc-act.c (finish_var_decl): Pass location to finish_decl. (objc_get_parm_info): Same. (get_super_receiver): Same. * objc-act.c (objc_build_component_ref): Pass location to build_compound_ref. (build_module_initializer_routine): Pass location to c_end_compound_stmt. (objc_generate_static_init_call): Pass location to build_stmt. (build_typed_selector_reference): New location argument. (build_selector_reference): Same. (objc_substitute_decl): Pass location to build_array_ref. (next_sjlj_build_try_catch_finally): Pass location to build_stmt. (objc_begin_catch_clause): Same. (objc_finish_try_stmt): Same. (objc_finish_catch_clause): Pass location to c_end_compound_stmt. (objc_build_throw_stmt): New argument. (generate_shared_structures): Pass location to build_c_cast. (objc_build_message_expr): Use local location. (objc_finish_message_expr): Use input_location. (build_objc_method_call): New argument. (objc_build_selector_expr): Same. (get_super_receiver): Pass location to build_c_cast, build_modify_expr, build_compound_expr. * objc-act.c: Add location to all calls to start_struct, build_decl, finish_struct. gcc/ * tree-pretty-print.c (dump_generic_node): Dump column numbers. * gimple-pretty-print.c (dump_gimple_stmt): Same. * gimplify.c (gimplify_modify_expr): Set location for GIMPLE_ASSIGNs created. * c-parser.c (c_parser_binary_expression): Use current column while building binary operations. * common.opt (fshow-column): Enable by default. * tree-vrp.c (check_array_ref): Use warning_at. (check_array_bounds): Use location from call back if expr has no location. * tree.h: Add location argument to maybe_fold_*. * tree-ssa-ccp.c (ccp_fold): Pass location to maybe_fold_*. (maybe_fold_offset_to_array_ref): Add location argument and use it. (maybe_fold_offset_to_component_ref): Same. (maybe_fold_offset_to_reference): Same. (maybe_fold_offset_to_address): Same. (maybe_fold_stmt_indirect): Same. (maybe_fold_stmt_addition): Same. (fold_stmt_r): Pass location to maybe_fold_*. (fold_gimple_assign): Same. * c-tree.h: Add location argument to finish_decl, default_function_array_conversion, store_init_value. * c-decl.c (define_label): Use error_at. (c_make_fname_decl): Pass location to finish_decl. (finish_decl): New location argument. (build_compound_literal): Pass location to store_init_value. (grokdeclarator): Pass location to finish_decl. (grokfield): Same. * c-typeck.c (array_to_pointer_conversion): New location argument. (function_to_pointer_conversion): Same. (default_function_array_conversion): Same. (parser_build_unary_op): Pass location to overflow_warning. (parser_build_binary_op): Same. Use warning_at. (build_unary_op): Pass location to array_to_pointer_conversion. (build_c_cast): Pass location to digest_init. (build_modify_expr): New location argument. (convert_for_assignment): Same. (store_init_value): Same. (digest_init): Same. (output_init_element): Pass location to digest_init and array_to_pointer_conversion. (c_finish_return): Pass location to convert_for_assignment. * gimplify.c (gimplify_conversion): Pass location to maybe_fold_offset_to_address. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Pass location to maybe_fold_stmt_addition. * c-omp.c (c_finish_omp_atomic): Pass new location to build_modify_expr. (c_finish_omp_for): Same. * c-common.c (overflow_warning): New argument. * c-common.h: New argument to build_modify_expr, overflow_warning. * c-parser.c (c_parser_declaration_or_fndef): Pass location to finish_decl. (c_parser_initializer): Pass location to default_function_array_conversion. (c_parser_initelt): Same. (c_parser_initval): Same. (c_parser_asm_operands): Same. (c_parser_expr_no_commas): Same. Pass location to build_modify_expr. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Add location info to stack. Use it. (c_parser_unary_expression): Pass location to default_function_array_conversion, parser_build_unary_op, build_indirect_ref, c_parser_postfix_expression_after_primary. (c_parser_postfix_expression_after_primary): New location argument. Use it. (c_parser_expression_conv): Pass location to default_function_array_conversion. (c_parser_expr_list): Same. (c_parser_omp_atomic): Same. (c_parser_omp_for_loop): Same. * c-tree.h: (struct c_declarator): Add comment to id_loc. (build_array_declarator): New argument. * c-decl.c (build_array_declarator): Add location argument. (grokdeclarator): Set id_loc for cdk_array. * c-parser.c (c_parser_direct_declarator_inner): Pass location to build_array_declarator. * tree.c (build_omp_clause): Add location argument. * tree.h (OMP_CLAUSE_HAS_LOCATION): New macro. (OMP_CLAUSE_LOCATION): New macro. (struct tree_omp_clause): Add location field. (build_omp_clause): Add argument. * testsuite/gcc.dg/gomp/for-1.c: Fix column. * cp/pt.c (tsubst_omp_for_iterator): Pass location to build_omp_clause. * cp/parser.c (cp_parser_omp_var_list_no_open): Same. (cp_parser_omp_clause_collapse): Same. (cp_parser_omp_clause_default): Same. (cp_parser_omp_clause_if): Same. (cp_parser_omp_clause_nowait): Same. (cp_parser_omp_clause_num_threads): Same. (cp_parser_omp_clause_ordered): Same. (cp_parser_omp_clause_schedule): Same. (cp_parser_omp_clause_untied): Same. (cp_parser_omp_for_loop): Same. (cp_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (c_start_case): Add location argument. (c_process_expr_stmt): Same. (c_finish_goto_*): Same. * tree-parloops.c (initialize_reductions): Pass location to build_omp_clause. (create_parallel_loop): Same. * fortran/trans-openmp.c (gfc_trans_omp_variable_list): Same. (gfc_trans_omp_reduction_list): Same. (gfc_trans_omp_clauses): Same. (gfc_trans_omp_do): Same. * c-typeck.c (c_finish_goto_label): Same. (c_finish_goto_ptr): New location argument. (c_start_case): Same. (emit_side_effect_warnings): Same. (c_process_expr_stmt): Same. (c_finish_stmt_expr): Same. (c_finish_omp_clauses): Use error_at instead of error. * gimplify.c (gimplify_adjust_omp_clauses_1): Pass location to build_omp_clause. * c-omp.c (c_split_parallel_clauses): New location argument. * tree-nested.c (convert_nonlocal_reference_stmt): Pass location to build_omp_clause. (convert_local_reference_stmt): Same. (convert_gimple_call): Same. * c-common.h (c_split_parallel_clauses): New argument. * c-parser.c (c_parser_statement_after_labels): Pass location to c_finish_goto_label. (c_parser_switch_statement): Pass location to c_start_case. (c_parser_for_statement): Pass location to c_finish_expr_stmt, and c_process_expr_stmt. (c_parser_omp_variable_list): Add location argument. (c_parser_omp_clause_collapse): Pass location to build_omp_clause. (c_parser_omp_clause_default): Same. (c_parser_omp_clause_if): Same. (c_parser_omp_clause_num_threads): Same. (-c_parser_omp_clause_ordered): Same. (c_parser_omp_clause_reduction): Pass location to c_parser_omp_variable_list. (c_parser_omp_clause_schedule): Pass location to build_omp_clause. (c_parser_omp_clause_untied): Same. (c_parser_omp_for_loop): Pass location to c_process_expr_stmt. (c_parser_omp_parallel): Pass location to c_split_parallel_clauses. * c-tree.h (check_for_loop_decls, undeclared_variable, build_component_ref, build_array_ref, build_external_ref, c_expr_sizeof_expr, c_expr_sizeof_type, parser_build_unary_op, build_conditional_expr, build_compound_expr, c_cast_expr, build_c_cast, build_asm_expr, c_end_compound_stmt, c_finish_stmt_expr, c_finish_return, c_finish_omp_parallel, c_finish_omp_task): New argument. * c-semantics.c (build_stmt): Same. (build_case_label): Same. * c-decl.c (c_finish_incomplete_decl): Pass location on down. (undeclared_variable): New argument. (make_label): Same. (lookup_label): Pass location on down. (define_label): Same. (finish_decl): Same. (build_compound_literal): Same. (finish_struct): Same. (finish_function): Do not set location here. (check_for_loop_decls): New argument. * tree.c (save_expr): Set location. (build_empty_stmt): New argument. * tree.h (build_empty_stmt): New argument to build_empty_stmt. (CAN_HAVE_LOCATION_P): Make sure we have a non empty node. * builtins.c (gimplify_va_arg_expr): Use locations. (expand_builtin_sync_operation): Same. * c-typeck.c (build_component_ref): New argument. (build_array_ref): Same. (build_external_ref): Same. (c_expr_sizeof_expr): Same. (c_expr_sizeof_type): Same. (parser_build_unary_op): Same. (build_conditional_expr): Same. (build_compound_expr): Pass location on down. (build_compound_expr): New argument. (build_c_cast): Same. (c_cast_expr): Same. (build_asm_expr): Same. (c_finish_return): Same. (c_process_expr_stmt): Pass location on down. (c_finish_stmt_expr): New argument. (push_clenaup): Same. (c_finish_omp_parallel): Same. (c_finish_omp_task): Same. * gimplify.c (gimplify_call_expr): Pass location on down. * c-omp.c (c_finish_omp_master): New argument. (c_finish_omp_critical): Same. (c_finish_omp_ordered): Same. (c_finish_omp_barrier): Same. (-c_finish_omp_taskwait): Same. (c_finish_omp_atomic): Same. (c_finish_omp_flush): Same. * tree-inline.c (copy_tree_body_r): Pass location on down. (inline_forbidden_p): Remove use of input_location. * c-gimplify.c (c_build_bind_expr): New argument. * c-common.c (c_common_truthvalue_conversion): Pass location on down. (c_sizeof_or_alignof_type): New argument. (c_alignof_expr): Same. (build_va_arg): Same. (c_add_case_label): Same. * c-common.h (c_sizeof_or_alignof_type, c_alignof_expr, c_sizeof, c_alignof, build_va_arg, build_stmt, build_case_label, c_build_bind_expr, objc_build_selector_expr, objc_build_throw_stmt, c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered, c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush, c_finish_omp_taskwait, c_finish_omp_for, c_split_parallel_clauses): New argument. * stub-objc.c (objc_build_selector_expr): Same. (objc_build_throw_stmt): Same. * c-parser.c (c_parser_declaration_or_fndef): Pass location on down. (c_parser_initelt): Same. (c_parser_compound_statement): Same. (c_parser_compound_statement_nostart): Same. (c_parser_label): Same. (c_parser_statement_after_labels): Same. (c_parser_if_body): Same. (c_parser_else_body): Same. (c_parser_if_statement): Same. (c_parser_switch_statement): Same. (c_parser_while_statement): Same. (c_parser_do_statement): Same. (c_parser_for_statement): Same. (c_parser_asm_statement): Same. (c_parser_conditional_expression): Same. (c_parser_binary_expression): Same. (c_parser_cast_expression): Same. (c_parser_unary_expression): Same. (c_parser_sizeof_expression): Same. (c_parser_alignof_expression): Same. (c_parser_postfix_expression): Same. (c_parser_expression): Same. (c_parser_objc_receiver): Same. (c_parser_omp_variable_list): Same. (c_parser_omp_structured_block): Same. (c_parser_omp_atomic): New argument. (c_parser_omp_barrier): Same. (c_parser_omp_critical): Same. (c_parser_omp_flush): Pass location on down. (c_parser_omp_for_loop): New argument. (c_parser_omp_for): Same. (c_parser_omp_master): Same. (c_parser_omp_ordered): Same. (c_parser_omp_sections_scope): Same. (c_parser_omp_sections): Same. (c_parser_omp_parallel): Same. (c_parser_omp_single): Same. (c_parser_omp_task): Same. (c_parser_omp_taskwait): Pass location on down. (c_parser_omp_construct): Same. (c_parser_omp_threadprivate): Same. * dwarf2asm.c, targhooks.c, optabs.c, tree.c, tree.h, target.h, builtins.c, omp-low.c, cgraphunit.c, tree-call-cdce.c, tree-ssa-alias.c, gimple-low.c, c-tree.h, expr.c, tree-parloops.c, c-decl.c, tree-eh.c, langhooks.c, function.c, stor-layout.c, c-typeck.c, gimplify.c, c-pragma.c, expmed.c, except.c, coverage.c, emit-rtl.c, cfgexpand.c, tree-mudflap.c, varasm.c, tree-nested.c, rtl.h, tree-inline.c, tree-profile.c, c-common.c, c-common.h, tree-switch-conversion.c, tree-cfg.c, ipa-struct-reorg.c, c-parser.c, config/i386/i386.c, stmt.c: Add location argument to the following function definitions and/or function calls: build_decl, objcp_start_struct, objcp_finish_struct, start_struct, finish_struct, PUSH_FIELD, create_artificial_label, cp_make_fname_decl, pushtag, implicitly_declare, c_make_fname_decl, build_compound_literal, parser_xref_tag, resolve_overloaded_builtin, do_case, c_finish_bc_stmt, build_compound_literal, build_function_call. * c-decl.c (build_compound_literal): Add location argument. Make all diagnostic calls use location. (start_struct): Same. (finish_struct): Same. (start_enum): Same. (build_enumerator): Same. (start_function): Same. (grokdeclarator): Make all diagnostic calls use location. (store_parm_decls_oldstyle): Same. * c-typeck.c (build_function_call): Add location argument. Make all diagnostic calls use location. (do_case): Same. (c_finish_bc_stmt): Same. * tree-nested.c (get_trampoline_type): Add argument. Pass location to build_decl. (lookup_tramp_for_decl): Pass location to get_trampoline_type. * rtl.h (RTL_LOCATION): New. * c-common.c (c_add_case_label): Add location argument. Make all diagnostic calls use location. * c-common.h: Add location argument to make_fname_decl, do_case, c_add_case_label, build_function_call, resolve_overloaded_builtin. * c-parser.c (c_parser_enum_specifier): Rename ident_loc to enum_loc. Set it appropriately for every case. Pass enum_loc to start_enum call. Pass value_loc first to build_enumerator. Pass enum_loc to parser_xref_tag. (c_parser_struct_or_union_specifier): Save location. Use it for start_struct, finish_struct, and parser_xref_tag. gcc/testsuite/ * gcc.dg/old-style-prom-3.c: Add column info. * gcc.dg/overflow-warn-1.c * gcc.dg/gomp/pr27415.c * gcc.dg/gomp/for-1.c: Same. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/c99-tag-3.c: Same. * gcc.dg/Wredundant-decls-2.c: Same. * gcc.dg/func-ptr-conv-1.c: Same. * gcc.dg/asm-wide-1.c: Same. * gcc.dg/nofixed-point-2.c: Same. * gcc.dg/cpp/line3.c: Same. * gcc.dg/array-10.c: Same. * gcc.dg/c99-vla-jump-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/Wshadow-3.c: Same. * gcc.dg/c90-const-expr-8.c: Same. * gcc.dg/label-decl-2.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/c90-const-expr-5.c: Same. * gcc.dg/builtins-30.c: Same. * gcc.dg/Warray-bounds.c: Same. * gcc.dg/Wcxx-compat-2.c: Same. * gcc.dg/tree-ssa/col-1.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/cast-function-1.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/vla-8.c: Same. * gcc.dg/gomp/pr27415.c: Move firstprivate diagnostics to correct line. * gcc.dg/label-decl-2.c: Move label diagnostic to correct line. * gcc.dg/old-style-prom-3.c: Check for error on the correct line. * gcc.dg/enum-compat-1.c: Same. * gcc.dg/dremf-type-compat-2.c: Same. * gcc.dg/old-style-prom-2.c: Same. * gcc.dg/pr15698-1.c: Same. * gcc.dg/pr20368-1.c: Same. * gcc.dg/dremf-type-compat-3.c: Same. * gcc.dg/builtins-30.c: Same. Test for columns. gcc/objcp/ * objcp-decl.h (c_end_compound_stmt): New argument. * objcp-decl.c (objcp_start_struct): Add argument. (objcp_finish_struct): Same. gcc/cp/ * typeck.c (cp_build_binary_op): Pass location to overflow_warning. (build_modify_expr): New arg. * semantics.c (finish_unary_op_expr): Pass location to overflow_warning. (handle_omp_for_class_iterator): Pass location to build_modify_expr. * typeck.c (cxx_sizeof_or_alignof_type): Pass location to c_sizeof_or_alignof_type. (build_array_ref): New argument. (build_compound_expr): Same. (build_const_cast): Same. (build_ptrmemfunc): Pass location to build_c_cast. * init.c (avoid_placement_new_aliasing): Pass location to build_stmt. (build_vec_delete_1): Pass location to cp_build_modify_expr, build_compound_expr. * class.c (build_vtbl_ref_1): Pass location to build_array_ref. * decl.c (poplevel): Pass location to c_build_bind_expr. (finish_case_label): Pass location to build_case_label. (finish_constructor_body): Same. (finish_destructor_body): Pass location to build_stmt. (cxx_maybe_build_cleanup): Same, but to build_compound_expr. * call.c (build_new_op): Pass location to build_array_ref. (build_x_va_arg): Pass location to build_va_arg. * except.c (expand_end_catch_block): Pass location to build_stmt. * cp-tree.h (build_array_ref): New argument. (build_compound_expr): Same. (build_c_cast): Same. * cp-gimplify.c (gimplify_if_stmt): Pass location on down. (gimplify_switch_stmt): Same. * typeck2.c (split_nonconstant_init_1): Same. * pt.c (tsubst_copy): Same. * semantics.c (add_decl_expr): Same. (do_poplevel): Same. (push_cleanup): Same. (finish_goto_stmt): Same. (finish_expr_stmt): Same. (begin_if_stmt): Same. (begin_while_stmt): Same. (begin_do_stmt): Same. (finish_return_stmt): Same. (begin_for_stmt): Same. (finish_break_stmt): Same. (finish_continue_stmt): Same. (begin_switch_stmt): Same. (begin_try_block): Same. (begin_handler): Same. (finish_asm_stmt): Same. (finish_label_stmt): Same. (finish_stmt_expr_expr): Same. (finalize_nrv_r): Same. (finish_omp_atomic): Same. * name-lookup.c (do_using_directive): Same. * decl2.c (grok_array_decl): Same. * parser.c (cp_parser_cast_expression): Same. (cp_parser_selection_statement): Same. (cp_parser_implicitly_scoped_statement): Same. (cp_parser_objc_selector_expression): Same. (cp_parser_objc_synchronized_statement): Same. (cp_parser_objc_throw_statement): Same. (cp_parser_omp_critical): Same. (cp_parser_omp_master): Same. * typeck.c (build_function_call): Add location argument. * init.c: Add location argument to all build_decl calls. * class.c: Same. * method.c: Same. * rtti.c: Same. * tree.c: Same. * pt.c: Same. * semantics.c: Same. * lex.c: Same. * decl2.c: Same. * cp-gimplify.c: Same. * decl.c: Same. (cp_make_fname_decl): Add location argument. Pass location ot build_decl. (finish_case_label): Same. * cp-tree.h (finish_case_label): Add location argument. * parser.c (cp_parser_label_for_labeled_statement): Pass location to finish_case_label. gcc/fortran/ * trans-array.c (gfc_trans_allocate_array_storage): Pass location on down. (gfc_trans_array_constructor_value): Same. (gfc_trans_scalarized_loop_end): Same. (gfc_conv_ss_startstride): Same. (gfc_trans_g77_array): Same. (gfc_trans_dummy_array_bias): Same. (gfc_conv_array_parameter): Same. (structure_alloc_comps): Same. * trans-expr.c (gfc_conv_function_call): Same. (fill_with_spaces): Same. (gfc_trans_string_copy): Same. (gfc_trans_scalar_assign): Same. * trans-stmt.c (gfc_trans_goto): Same. (gfc_trans_if_1): Same. (gfc_trans_simple_do): Same. (gfc_trans_do): Same. (gfc_trans_do_while): Same. (gfc_trans_logical_select): Same. (gfc_trans_select): Same. (gfc_trans_forall_loop): Same. (gfc_trans_nested_forall_loop): Same. (generate_loop_for_temp_to_lhs): Same. (generate_loop_for_rhs_to_temp): Same. (gfc_trans_forall_1): Same. (gfc_trans_where_assign): Same. (gfc_trans_where_3): Same. (gfc_trans_allocate): Same. * trans.c (gfc_finish_block): Same. (gfc_trans_runtime_check): Same. (gfc_call_malloc): Same. (gfc_allocate_with_status): Same. (gfc_call_free): Same. (gfc_deallocate_with_status): Same. (gfc_call_realloc): Same. (gfc_trans_code): Same. * trans-decl.c (gfc_init_default_dt): Same. (gfc_generate_constructors): Same. * trans-io.c (gfc_trans_io_runtime_check): Same. * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Same. (gfc_conv_intrinsic_fdate): Same. (gfc_conv_intrinsic_ttynam): Same. (gfc_conv_intrinsic_minmax): Same. (gfc_conv_intrinsic_minmax_char): Same. (gfc_conv_intrinsic_anyall): Same. (gfc_conv_intrinsic_count): Same. (gfc_conv_intrinsic_arith): Same. (gfc_conv_intrinsic_minmaxloc): Same. (gfc_conv_intrinsic_minmaxval): Same. (gfc_conv_intrinsic_rrspacing): Same. (gfc_conv_intrinsic_array_transfer): Same. (gfc_conv_intrinsic_trim): Same. (gfc_conv_intrinsic_repeat): Same. From-SVN: r148442
2009-06-13 00:06:47 +02:00
resdecl = build_decl (input_location,
RESULT_DECL, NULL_TREE, void_type_node);
DECL_ARTIFICIAL (resdecl) = 1;
DECL_RESULT (decl) = resdecl;
DECL_CONTEXT (resdecl) = decl;
allocate_struct_function (decl, false);
TREE_STATIC (decl) = 1;
TREE_USED (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1;
DECL_SAVED_TREE (decl) = body;
if (!targetm.have_ctors_dtors)
{
TREE_PUBLIC (decl) = 1;
DECL_PRESERVE_P (decl) = 1;
}
DECL_UNINLINABLE (decl) = 1;
DECL_INITIAL (decl) = make_node (BLOCK);
TREE_USED (DECL_INITIAL (decl)) = 1;
DECL_SOURCE_LOCATION (decl) = input_location;
cfun->function_end_locus = input_location;
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
switch (which)
{
case 'I':
DECL_STATIC_CONSTRUCTOR (decl) = 1;
decl_init_priority_insert (decl, priority);
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
break;
case 'D':
DECL_STATIC_DESTRUCTOR (decl) = 1;
decl_fini_priority_insert (decl, priority);
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
break;
default:
gcc_unreachable ();
}
gimplify_function_tree (decl);
cgraph_add_new_function (decl, false);
cgraph_mark_needed_node (cgraph_node (decl));
set_cfun (NULL);
}
void
init_cgraph (void)
{
cgraph_dump_file = dump_begin (TDI_cgraph, NULL);
}
2006-05-19 00:16:23 +02:00
/* The edges representing the callers of the NEW_VERSION node were
fixed by cgraph_function_versioning (), now the call_expr in their
respective tree code should be updated to call the NEW_VERSION. */
static void
update_call_expr (struct cgraph_node *new_version)
{
struct cgraph_edge *e;
gcc_assert (new_version);
backport: ChangeLog.tuples: ChangeLog from gimple-tuples-branch. 2008-07-28 Richard Guenther <rguenther@suse.de> Merge from gimple-tuples-branch. * ChangeLog.tuples: ChangeLog from gimple-tuples-branch. * gimple.def: New file. * gsstruct.def: Likewise. * gimple-iterator.c: Likewise. * gimple-pretty-print.c: Likewise. * tree-gimple.c: Removed. Merged into ... * gimple.c: ... here. New file. * tree-gimple.h: Removed. Merged into ... * gimple.h: ... here. New file. * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h. * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the --enable-checking=gimple flag. * config.in: Likewise. * configure: Regenerated. * tree-ssa-operands.h: Tuplified. * tree-vrp.c: Likewise. * tree-loop-linear.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-dump.c: Likewise. * tree-complex.c: Likewise. * cgraphbuild.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-pretty-print.c: Likewise. * tracer.c: Likewise. * gengtype.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * tree-ssa-loop-manip.c: Likewise. * value-prof.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-tailcall.c: Likewise. * value-prof.h: Likewise. * tree.c: Likewise. * tree.h: Likewise. * tree-pass.h: Likewise. * ipa-cp.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-scalar-evolution.h: Likewise. * target.h: Likewise. * lambda-mat.c: Likewise. * tree-phinodes.c: Likewise. * diagnostic.h: Likewise. * builtins.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * cfghooks.c: Likewise. * fold-const.c: Likewise. * cfghooks.h: Likewise. * omp-low.c: Likewise. * tree-ssa-dse.c: Likewise. * ipa-reference.c: Likewise. * tree-ssa-uncprop.c: Likewise. * toplev.c: Likewise. * tree-gimple.c: Likewise. * tree-gimple.h: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sccvn.h: Likewise. * cgraphunit.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-nomudflap.c: Likewise. * tree-call-cdce.c: Likewise. * ipa-pure-const.c: Likewise. * c-format.c: Likewise. * tree-stdarg.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-nrv.c: Likewise. * tree-ssa-propagate.c: Likewise. * ipa-utils.c: Likewise. * tree-ssa-propagate.h: Likewise. * tree-ssa-alias.c: Likewise. * gimple-low.c: Likewise. * tree-ssa-sink.c: Likewise. * ipa-inline.c: Likewise. * c-semantics.c: Likewise. * dwarf2out.c: Likewise. * expr.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * predict.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-parloops.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * matrix-reorg.c: Likewise. * c-decl.c: Likewise. * tree-eh.c: Likewise. * c-pretty-print.c: Likewise. * lambda-trans.c: Likewise. * function.c: Likewise. * langhooks.c: Likewise. * ebitmap.h: Likewise. * tree-vectorizer.c: Likewise. * function.h: Likewise. * langhooks.h: Likewise. * tree-vectorizer.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * domwalk.c: Likewise. * tree-if-conv.c: Likewise. * profile.c: Likewise. * domwalk.h: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-flow-inline.h: Likewise. * tree-affine.c: Likewise. * tree-vect-analyze.c: Likewise. * c-typeck.c: Likewise. * gimplify.c: Likewise. * coretypes.h: Likewise. * tree-ssa-phiopt.c: Likewise. * calls.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree.def: Likewise. * tree-dfa.c: Likewise. * except.c: Likewise. * except.h: Likewise. * cfgexpand.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-live.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.h: Likewise. * tree-predcom.c: Likewise. * lambda.h: Likewise. * tree-mudflap.c: Likewise. * ipa-prop.c: Likewise. * print-tree.c: Likewise. * tree-ssa-copy.c: Likewise. * ipa-prop.h: Likewise. * tree-ssa-forwprop.c: Likewise. * ggc-page.c: Likewise. * c-omp.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-nested.c: Likewise. * tree-ssa.c: Likewise. * lambda-code.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-inline.c: Likewise. * tree-inline.h: Likewise. * tree-iterator.c: Likewise. * tree-optimize.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-vect-transform.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * cfgloop.c: Likewise. * system.h: Likewise. * tree-profile.c: Likewise. * cfgloop.h: Likewise. * c-gimplify.c: Likewise. * c-common.c: Likewise. * tree-vect-generic.c: Likewise. * tree-flow.h: Likewise. * c-common.h: Likewise. * basic-block.h: Likewise. * tree-ssa-structalias.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-ssa-structalias.h: Likewise. * tree-cfg.c: Likewise. * passes.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * tree-ssa-reassoc.c: Likewise. * cfgrtl.c: Likewise. * varpool.c: Likewise. * stmt.c: Likewise. * tree-ssanames.c: Likewise. * tree-ssa-threadedge.c: Likewise. * langhooks-def.h: Likewise. * tree-ssa-operands.c: Likewise. * config/alpha/alpha.c: Likewise. * config/frv/frv.c: Likewise. * config/s390/s390.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32c/m32c-protos.h: Likewise. * config/spu/spu.c: Likewise. * config/sparc/sparc.c: Likewise. * config/i386/i386.c: Likewise. * config/sh/sh.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/pa/pa.c: Likewise. * config/mips/mips.c: Likewise. From-SVN: r138207
2008-07-28 16:33:56 +02:00
/* Update the call expr on the edges to call the new version. */
for (e = new_version->callers; e; e = e->next_caller)
{
struct function *inner_function = DECL_STRUCT_FUNCTION (e->caller->decl);
gimple_call_set_fndecl (e->call_stmt, new_version->decl);
maybe_clean_eh_stmt_fn (inner_function, e->call_stmt);
}
}
/* Create a new cgraph node which is the new version of
OLD_VERSION node. REDIRECT_CALLERS holds the callers
edges which should be redirected to point to
NEW_VERSION. ALL the callees edges of OLD_VERSION
are cloned to the new version node. Return the new
version node. */
static struct cgraph_node *
cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
tree new_decl,
VEC(cgraph_edge_p,heap) *redirect_callers)
{
struct cgraph_node *new_version;
struct cgraph_edge *e;
struct cgraph_edge *next_callee;
unsigned i;
gcc_assert (old_version);
2006-05-19 00:16:23 +02:00
new_version = cgraph_node (new_decl);
new_version->analyzed = true;
new_version->local = old_version->local;
new_version->global = old_version->global;
new_version->rtl = new_version->rtl;
new_version->reachable = true;
new_version->count = old_version->count;
/* Clone the old node callees. Recursive calls are
also cloned. */
for (e = old_version->callees;e; e=e->next_callee)
{
cgraph_clone_edge (e, new_version, e->call_stmt,
e->lto_stmt_uid, REG_BR_PROB_BASE,
CGRAPH_FREQ_BASE,
e->loop_nest, true);
}
/* Fix recursive calls.
If OLD_VERSION has a recursive call after the
previous edge cloning, the new version will have an edge
pointing to the old version, which is wrong;
Redirect it to point to the new version. */
for (e = new_version->callees ; e; e = next_callee)
{
next_callee = e->next_callee;
if (e->callee == old_version)
cgraph_redirect_edge_callee (e, new_version);
2006-05-19 00:16:23 +02:00
if (!next_callee)
break;
}
for (i = 0; VEC_iterate (cgraph_edge_p, redirect_callers, i, e); i++)
{
/* Redirect calls to the old version node to point to its new
version. */
cgraph_redirect_edge_callee (e, new_version);
}
return new_version;
}
/* Perform function versioning.
2006-05-19 00:16:23 +02:00
Function versioning includes copying of the tree and
a callgraph update (creating a new cgraph node and updating
its callees and callers).
REDIRECT_CALLERS varray includes the edges to be redirected
to the new version.
TREE_MAP is a mapping of tree nodes we want to replace with
new ones (according to results of prior analysis).
OLD_VERSION_NODE is the node that is versioned.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
It returns the new version's cgraph node.
ARGS_TO_SKIP lists arguments to be omitted from functions
*/
struct cgraph_node *
cgraph_function_versioning (struct cgraph_node *old_version_node,
VEC(cgraph_edge_p,heap) *redirect_callers,
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
VEC (ipa_replace_map_p,gc)* tree_map,
bitmap args_to_skip)
{
tree old_decl = old_version_node->decl;
struct cgraph_node *new_version_node = NULL;
tree new_decl;
if (!tree_versionable_function_p (old_decl))
return NULL;
/* Make a new FUNCTION_DECL tree node for the
new version. */
if (!args_to_skip)
new_decl = copy_node (old_decl);
else
new_decl = build_function_decl_skip_args (old_decl, args_to_skip);
/* Create the new version's call-graph node.
and update the edges of the new node. */
new_version_node =
cgraph_copy_node_for_versioning (old_version_node, new_decl,
redirect_callers);
/* Copy the OLD_VERSION_NODE function tree to the new version. */
tree_function_versioning (old_decl, new_decl, tree_map, false, args_to_skip);
2006-05-19 00:16:23 +02:00
/* Update the new version's properties.
Make The new version visible only within this translation unit. Make sure
that is not weak also.
2006-05-19 00:16:23 +02:00
??? We cannot use COMDAT linkage because there is no
ABI support for this. */
cgraph_make_decl_local (new_version_node->decl);
DECL_VIRTUAL_P (new_version_node->decl) = 0;
new_version_node->local.externally_visible = 0;
new_version_node->local.local = 1;
new_version_node->lowered = true;
/* Update the call_expr on the edges to call the new version node. */
update_call_expr (new_version_node);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
cgraph.c (first_cgraph_function_insertion_hook): New variable. * cgraph.c (first_cgraph_function_insertion_hook): New variable. (cgraph_add_function_insertion_hook, cgraph_remove_function_insertion_hook, cgraph_call_function_insertion_hooks): New functions. * cgraph.h (cgraph_add_function_insertion_hook, cgraph_remove_function_insertion_hook, cgraph_call_function_insertion_hooks): Declare. * ipa-reference.c (function_insertion_hook_holder): New variable. (check_operand, look_for_address_of): When checking late, do not care about module bitmaps. (add_new_function): New function. (generate_summary): Register hooks; zero module bitmaps. (propagate): Unregister hooks. * ipa-pure-const.c (function_insertion_hook_holder): New variable. (add_new_function): New function. (generate_summary): Register hook. (propagate): Remove hook. * ipa-cp.c (ipcp_need_redirect_p): Fix to not be constant 0. * tree-pass.h (pass_ipa_cp): Make ipa_opt_pass. * ipa-cp.c (ipcp_update_cloned_node): New function. (build_const_val): Handle functions correctly; bring type logic into sync with tree-inline.c (ipcp_init_stage): Take care of computing stuff needed by indirect inlining; update clones. (ipcp_generate_summary): Break out of ipcp_driver. (ipcp_driver): Do only execution and transformation. (pass_ipa_cp): Make IPA_PASS. * tree-ssa-ccp.c (fold_stmt_r): Check type before trying to fold offset to address. * ipa-inline.c (inline_indirect_intraprocedural_analysis): When doing ipcp, some info is already available. * ipa-prop.c (ipa_count_arguments): Grow edge lists as needed. * tree-inline.c (remap_ssa_name): Unshare expression. From-SVN: r139389
2008-08-21 17:26:59 +02:00
cgraph_call_function_insertion_hooks (new_version_node);
return new_version_node;
}
/* Produce separate function body for inline clones so the offline copy can be
modified without affecting them. */
struct cgraph_node *
save_inline_function_body (struct cgraph_node *node)
{
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
struct cgraph_node *first_clone, *n;
gcc_assert (node == cgraph_node (node->decl));
cgraph_lower_function (node);
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
first_clone = node->clones;
first_clone->decl = copy_node (node->decl);
cgraph_insert_node_to_hashtable (first_clone);
gcc_assert (first_clone == cgraph_node (first_clone->decl));
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
if (first_clone->next_sibling_clone)
{
for (n = first_clone->next_sibling_clone; n->next_sibling_clone; n = n->next_sibling_clone)
n->clone_of = first_clone;
n->clone_of = first_clone;
n->next_sibling_clone = first_clone->clones;
if (first_clone->clones)
first_clone->clones->prev_sibling_clone = n;
first_clone->clones = first_clone->next_sibling_clone;
first_clone->next_sibling_clone->prev_sibling_clone = NULL;
first_clone->next_sibling_clone = NULL;
gcc_assert (!first_clone->prev_sibling_clone);
}
first_clone->clone_of = NULL;
node->clones = NULL;
if (first_clone->clones)
for (n = first_clone->clones; n != first_clone;)
{
gcc_assert (n->decl == node->decl);
n->decl = first_clone->decl;
if (n->clones)
n = n->clones;
else if (n->next_sibling_clone)
n = n->next_sibling_clone;
else
{
while (n != first_clone && !n->next_sibling_clone)
n = n->clone_of;
if (n != first_clone)
n = n->next_sibling_clone;
}
}
/* Copy the OLD_VERSION_NODE function tree to the new version. */
tree_function_versioning (node->decl, first_clone->decl, NULL, true, NULL);
DECL_EXTERNAL (first_clone->decl) = 0;
cgraphunit.c (cgraph_function_versioning,save_inline_function_body): Use DECL_COMDAT_GROUP instead of DECL_ONE_ONLY. 2009-06-15 Rafael Avila de Espindola <espindola@google.com> * cgraphunit.c (cgraph_function_versioning,save_inline_function_body): Use DECL_COMDAT_GROUP instead of DECL_ONE_ONLY. * cgraph.c (cgraph_create_virtual_clone): Use DECL_COMDAT_GROUP. * config/i386/i386.c (ix86_file_end): Compute DECL_COMDAT_GROUP. * dwarf2asm.c(dw2_force_const_mem): Update call to make_decl_one_only. * langhooks-def.h (lhd_comdat_group, LANG_HOOKS_COMDAT_GROUP): Remove. (LANG_HOOKS_DECLS): Remove LANG_HOOKS_COMDAT_GROUP. * langhooks.c (lhd_comdat_group): Remove. * langhooks.h (lang_hooks_for_decls): Remove comdat_group. * tree.h (DECL_COMDAT_GROUP): New. (DECL_ONE_ONLY): Use DECL_COMDAT_GROUP. (tree_decl_with_vis): Add comdat_group. Remove one_only. (make_decl_one_only): Change signature. * varasm.c (get_emutls_init_templ_addr, emutls_decl): Update call to make_decl_one_only. (make_decl_one_only): Change signature. (default_elf_asm_named_section): Use DECL_COMDAT_GROUP. 2009-06-15 Rafael Avila de Espindola <espindola@google.com> * cp-objcp-common.h (LANG_HOOKS_COMDAT_GROUP): Remove. * cp-tree.h (cxx_comdat_group): Change signature. * decl.c (duplicate_decls): Use DECL_COMDAT_GROUP. (cxx_comdat_group): Change signature. * decl2.c (comdat_linkage, maybe_make_one_only): Update call to make_decl_one_only. (constrain_visibility, get_guard): Use DECL_COMDAT_GROUP. * method.c (use_thunk): Update call to make_decl_one_only. * optimize.c (maybe_clone_body): Use DECL_COMDAT_GROUP 2009-06-15 Rafael Avila de Espindola <espindola@google.com> * g++.dg/abi/mangle11.C: Update warning line. * g++.dg/abi/mangle12.C: Update warning line. * g++.dg/abi/mangle17.C: Update warning line. * g++.dg/abi/mangle20-2.C: Update warning line. From-SVN: r148492
2009-06-15 16:25:50 +02:00
DECL_COMDAT_GROUP (first_clone->decl) = NULL_TREE;
TREE_PUBLIC (first_clone->decl) = 0;
DECL_COMDAT (first_clone->decl) = 0;
VEC_free (ipa_opt_pass, heap,
first_clone->ipa_transforms_to_apply);
first_clone->ipa_transforms_to_apply = NULL;
#ifdef ENABLE_CHECKING
verify_cgraph_node (first_clone);
#endif
return first_clone;
}
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
/* Given virtual clone, turn it into actual clone. */
static void
cgraph_materialize_clone (struct cgraph_node *node)
{
bitmap_obstack_initialize (NULL);
/* Copy the OLD_VERSION_NODE function tree to the new version. */
tree_function_versioning (node->clone_of->decl, node->decl,
node->clone.tree_map, true,
node->clone.args_to_skip);
if (cgraph_dump_file)
{
dump_function_to_file (node->clone_of->decl, cgraph_dump_file, dump_flags);
dump_function_to_file (node->decl, cgraph_dump_file, dump_flags);
}
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
/* Function is no longer clone. */
if (node->next_sibling_clone)
node->next_sibling_clone->prev_sibling_clone = node->prev_sibling_clone;
if (node->prev_sibling_clone)
node->prev_sibling_clone->next_sibling_clone = node->next_sibling_clone;
else
node->clone_of->clones = node->next_sibling_clone;
node->next_sibling_clone = NULL;
node->prev_sibling_clone = NULL;
if (!node->clone_of->analyzed && !node->clone_of->clones)
cgraph_remove_node (node->clone_of);
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
node->clone_of = NULL;
bitmap_obstack_release (NULL);
}
/* If necessary, change the function declaration in the call statement
associated with E so that it corresponds to the edge callee. */
gimple
cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
{
tree decl = gimple_call_fndecl (e->call_stmt);
gimple new_stmt;
gimple_stmt_iterator gsi;
if (!decl || decl == e->callee->decl
/* Don't update call from same body alias to the real function. */
|| cgraph_get_node (decl) == cgraph_get_node (e->callee->decl))
return e->call_stmt;
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "updating call of %s/%i -> %s/%i: ",
cgraph_node_name (e->caller), e->caller->uid,
cgraph_node_name (e->callee), e->callee->uid);
print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
}
if (e->callee->clone.combined_args_to_skip)
new_stmt = gimple_call_copy_skip_args (e->call_stmt,
e->callee->clone.combined_args_to_skip);
else
new_stmt = e->call_stmt;
if (gimple_vdef (new_stmt)
&& TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME)
SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt;
gimple_call_set_fndecl (new_stmt, e->callee->decl);
gsi = gsi_for_stmt (e->call_stmt);
gsi_replace (&gsi, new_stmt, true);
update_stmt (new_stmt);
/* Update EH information too, just in case. */
maybe_clean_or_replace_eh_stmt (e->call_stmt, new_stmt);
cgraph_set_call_stmt_including_clones (e->caller, e->call_stmt, new_stmt);
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, " updated to:");
print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
}
return new_stmt;
}
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
/* Once all functions from compilation unit are in memory, produce all clones
and update all calls. We might also do this on demand if we don't want to
bring all functions to memory prior compilation, but current WHOPR
implementation does that and it is is bit easier to keep everything right in
this order. */
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
void
cgraph_materialize_all_clones (void)
{
struct cgraph_node *node;
bool stabilized = false;
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Materializing clones\n");
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
/* We can also do topological order, but number of iterations should be
bounded by number of IPA passes since single IPA pass is probably not
going to create clones of clones it created itself. */
while (!stabilized)
{
stabilized = true;
for (node = cgraph_nodes; node; node = node->next)
{
if (node->clone_of && node->decl != node->clone_of->decl
&& !gimple_has_body_p (node->decl))
{
if (gimple_has_body_p (node->clone_of->decl))
{
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "clonning %s to %s\n",
cgraph_node_name (node->clone_of),
cgraph_node_name (node));
if (node->clone.tree_map)
{
unsigned int i;
fprintf (cgraph_dump_file, " replace map: ");
for (i = 0; i < VEC_length (ipa_replace_map_p,
node->clone.tree_map);
i++)
{
struct ipa_replace_map *replace_info;
replace_info = VEC_index (ipa_replace_map_p,
node->clone.tree_map,
i);
print_generic_expr (cgraph_dump_file, replace_info->old_tree, 0);
fprintf (cgraph_dump_file, " -> ");
print_generic_expr (cgraph_dump_file, replace_info->new_tree, 0);
fprintf (cgraph_dump_file, "%s%s;",
replace_info->replace_p ? "(replace)":"",
replace_info->ref_p ? "(ref)":"");
}
fprintf (cgraph_dump_file, "\n");
}
if (node->clone.args_to_skip)
{
fprintf (cgraph_dump_file, " args_to_skip: ");
dump_bitmap (cgraph_dump_file, node->clone.args_to_skip);
}
if (node->clone.args_to_skip)
{
fprintf (cgraph_dump_file, " combined_args_to_skip:");
dump_bitmap (cgraph_dump_file, node->clone.combined_args_to_skip);
}
}
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
cgraph_materialize_clone (node);
}
else
stabilized = false;
}
}
}
for (node = cgraph_nodes; node; node = node->next)
if (!node->analyzed && node->callees)
cgraph_node_remove_callees (node);
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Updating call sites\n");
for (node = cgraph_nodes; node; node = node->next)
if (node->analyzed && !node->clone_of
&& gimple_has_body_p (node->decl))
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
{
struct cgraph_edge *e;
current_function_decl = node->decl;
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
for (e = node->callees; e; e = e->next_callee)
cgraph_redirect_edge_call_stmt_to_callee (e);
gcc_assert (!need_ssa_update_p (cfun));
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
pop_cfun ();
current_function_decl = NULL;
#ifdef ENABLE_CHECKING
verify_cgraph_node (node);
#endif
}
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Materialization Call site updates done.\n");
/* All changes to parameters have been performed. In order not to
incorrectly repeat them, we simply dispose of the bitmaps that drive the
changes. */
for (node = cgraph_nodes; node; node = node->next)
node->clone.combined_args_to_skip = NULL;
#ifdef ENABLE_CHECKING
verify_cgraph ();
#endif
cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. * cgraphbuild.c (compute_call_stmt_bb_frequency): Accept function argument; handle correctly when profile is absent. (build_cgraph_edges): Update. (rebuild_cgraph_edges): Update. * cgraph.c: Do not include varrau.h (cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones): New function (cgraph_update_edges_for_call_stmt_node): New stati cfunction. (cgraph_update_edges_for_call_stmt): Handle clones. (cgraph_remove_node): Handle clone tree. (cgraph_remove_node_and_inline_clones): New function. (dump_cgraph_node): Dump clone tree. (cgraph_clone_node): Handle clone tree. (clone_function_name): Bring here from tree-inline.c (cgraph_create_virtual_clone): New function. * cgraph.h (ipa_replace_map): Move ehre from ipa.h (cgraph_clone_info): New function (strut cgraph_node): Add clone_info and new clone tree pointers. (cgraph_remove_node_and_inline_clones, cgraph_set_call_stmt_including_clones, cgraph_create_edge_including_clones, cgraph_create_virtual_clone): Declare. (cgraph_function_versioning): Use VEC argument. (compute_call_stmt_bb_frequency): Update prototype. (cgraph_materialize_all_clones): New function. * ipa-cp.c (ipcp_update_cloned_node): Remove. (ipcp_create_replace_map): Update to VECtors. (ipcp_update_callgraph): Use virtual clones. (ipcp_update_bb_counts, ipcp_update_edges_counts): Remove. (ipcp_update_profiling): Do not update local profiling. (ipcp_insert_stage): Use VECtors and virtual clones. * cgraphunit.c (verify_cgraph_node): Verify clone tree. (clone_of_p): New function. (cgraph_preserve_function_body_p): Use clone tree. (cgraph_optimize): Materialize clones. (cgraph_function_versioning): Update for VECtors. (save_inline_function_body): Use clone tree. (cgraph_materialize_clone, cgraph_materialize_all_clones): New functions. * ipa-inline.c (cgraph_default_inline_p): Use analyzed flags. * ipa.c: Include gimple.h. (cgraph_remove_unreachable_nodes): Use clone tree. * ipa-prop.c (ipa_note_param_call): Update call of compute_call_stmt_bb_frequency. * ipa-prop.h (ipa_replace_map): Move to cgraph.h. * tree-inline.c: Do not include varray.h; do not include gt-tree-inline.h (copy_bb): Handle updating of clone tree; add new edge when new call appears. (expand_call_inline): Be strict about every call having edge. (clone_fn_id_num, clone_function_name): Move to cgraph.c. (delete_unreachable_blocks_update_callgraph): New function. (tree_function_versioning): Use VECtors; always remove unreachable blocks and fold conditionals. * tree-inline.h: Do not include varray.h (tree_function_versioning): Remove. * Makefile.in (GTFILES): Remove tree-inline.c * passes.c (do_per_function): Do only functions having body. * ipa-struct-reorg.c (do_reorg_1, collect_data_accesses): Handle cone tree. From-SVN: r147294
2009-05-08 21:19:51 +02:00
cgraph_remove_unreachable_nodes (false, cgraph_dump_file);
}
#include "gt-cgraphunit.h"