aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
AgeCommit message (Collapse)AuthorFilesLines
2010-07-08cgraph.c (cgraph_will_be_removed_from_program_if_no_direct_calls): New function.Jan Hubicka1-0/+2
* cgraph.c (cgraph_will_be_removed_from_program_if_no_direct_calls): New function. * cgraph.h (cgraph_will_be_removed_from_program_if_no_direct_calls): Declare. * ipa-cp.c (ipcp_estimate_growth): Use it. * ipa-inline.c (cgraph_estimate_growth, cgraph_decide_inlining): Likewise. From-SVN: r161966
2010-07-05cgraph.h (cgraph_node, [...]): Update docmentation of in_other_partition.Jan Hubicka1-2/+7
* cgraph.h (cgraph_node, cgraph_varpool_node): Update docmentation of in_other_partition. * lto-cgraph.c (referenced_from_other_partition_p, reachable_from_other_partition_p): Use in_other_partition flags. (output_node, output_varpool_node): COMDAT nodes always have private copies and thus are never used from other partition. * lto.c (add_cgraph_node_to_partition): Forward declare; walk also nodes from same comdat group as well as all comdat functions referenced here. (add_varpool_node_to_partition, add_references_to_partition): New function. (lto_1_1_map): Skip COMDAT fnctions/variables; use add_varpool_node_to_partition; clear aux flags when done. (lto_promote_cross_file_statics): Do not promote stuff that gets duplicated to each ltrans. From-SVN: r161846
2010-06-28cgraph.h (struct varpool_node): new used_from_object_file flag.Bingfeng Mei1-0/+5
2010-06-28 Bingfeng Mei <bmei@broadcom.com> * cgraph.h (struct varpool_node): new used_from_object_file flag. (struct cgraph_local_info): new used_from_object_file flag. * cgraph.c (dump_cgraph_node): dump used_from_object_file flag. (cgraph_clone_node): initialize used_from_object_file. (cgraph_create_virtual_clone): initialize used_from_object_file. * lto-symbtab.c (lto_symtab_merge_decls_1): Set used_from_object_file flags for symbols of LDPR_PREVAILING_DEF when compiling with -fwhole-program. (lto_symtab_resolve_symbols) Use LDPR_PREVAILING_DEF_IRONLY for internal resolver. * ipa.c (function_and_variable_visibility): Set externally_visible flag of varpool_node if used_from_object_file flag is set. (cgraph_externally_visible_p): check used_from_object_file flag. * doc/invoke.texi (-fwhole-program option): Change description of externally_visible attribute accordingly. * doc/extend.texi (externally_visible): Ditto. From-SVN: r161483
2010-06-09cgraph.h (varpool_first_static_initializer, [...]): Make checking only when ↵Jan Hubicka1-2/+2
checking enabled. * cgraph.h (varpool_first_static_initializer, varpool_next_static_initializer): Make checking only when checking enabled. * tree-vectorizer.h (vinfo_for_stmt): Remove check. (set_vinfo_for_stmt, get_earlier_stmt, is_loop_header_bb_p): Change gcc_assert to gcc_checking_assert. * tree-flow-inline.h (gimple_vop, get_var_ann, relink_imm_use, phi_nodes set_phi_nodes, phi_arg_index_from_use, op_iter_next_use, op_iter_next_def, op_iter_next_tree, op_iter_init, op_iter_init_use, op_iter_init_phiuse, op_iter_init_phidef, array_ref_contains_indirect_ref, ref_contains_array_ref): Use gcc_checking_assert. * emit-rtl.h (set_first_insn, set_last_insn): Likewise. * tree-ssa-live.h (var_to_partition, var_to_partition_to_var, partition_is_global, live_on_entry, live_on_exit, live_merge_and_clear): Likewise. * system.h (gcc_checking_assert): New macro. From-SVN: r160489
2010-06-04re PR lto/41584 (WHOPR doesn't grok empty units)Richard Guenther1-0/+2
2010-06-04 Richard Guenther <rguenther@suse.de> PR lto/41584 * cgraph.h (struct varpool_node): Add lto_file_data field. * lto-cgraph.c (input_varpool_node): Initialize it. lto/ * lto.c (lto_1_to_1_map): Use the proper file_data for varpool nodes. From-SVN: r160258
2010-06-01cgraph.h (tree_function_versioning): Update prototype.Jan Hubicka1-2/+4
* cgraph.h (tree_function_versioning): Update prototype. (cgraph_function_versioning): Update prototype. * cgraphunit.c (cgraph_copy_node_for_versioning): Accept bbs_to_copy bitmap. (cgraph_function_versioning): Accept new_entry_block and bbs_to_copy. (cgraph_materialize_clone, save_inline_function_body): Update use of tree_function_versioning. * tree-inline.c (copy_bb): Look for previous copied block to link after; fix debug output. (copy_cfg_body): Accept new_entry_block and bbs_to_copy. (copy_body): Likewise. (expand_call_inline): Update use of copy_body. (tree_function_versioning): Update use of copy body; accept blocks_to_copy and new_entry. From-SVN: r160110
2010-05-30cgraph.h (cgraph_dump_file): Declare.Jan Hubicka1-0/+1
* cgraph.h (cgraph_dump_file): Declare. * cgraphunit.c (cgraph_dump_file): Export. * ipa.c (dump_cgraph_node_set, dump_varpool_node_set): Be less verbose. * lto.c (promote_var, promote_fn, lto_wpa_write_files): Dump partitioning decisions. From-SVN: r160053
2010-05-30cgraph.h (cgraph_node_cannot_return, [...]): New functions.Jan Hubicka1-0/+2
* cgraph.h (cgraph_node_cannot_return, cgraph_edge_cannot_lead_to_return): New functions. * cgraph.c (cgraph_node_cannot_return, cgraph_edge_cannot_lead_to_return): Use them. * ipa-pure-const.c (pure_const_names): New static var. (check_call): Handle calls not leading to return. (pure_const_read_summary): Dump info read. (propagate): Dump info about propagation process; ignore side effects of functions not leading to exit; fix handling of pure functions. From-SVN: r160051
2010-05-29cgraph.h (struct varpool_node_set_def, [...]): Remove unused AUX pointer.Jan Hubicka1-4/+2
* cgraph.h (struct varpool_node_set_def, struct cgraph_node_set_def): Remove unused AUX pointer. (cgraph_node_set_nonempty_p, varpool_node_set_nonempty_p): Use VEC_empty macro. * lto.c (bitmap vector): Remove. (lto_cgraph_node_sets, lto_varpool_node_sets): Remove. (ltrans_partition_def): New structure. (ltrans_partition): New type and VECtor. (new_partition): New function. (add_cgraph_node_to_partition): New function. (lto_1_to_1_map): Reorganize for partitions. (lto_add_inline_clones): Remove. (lto_add_all_inlinees): Remove. (lto_promote_cross_file_statics): Use partitions. (cmp_partitions): New function. (lto_wpa_write_files): Do not call lto_add_all_inlinees; use partitions; output files sorted by size. From-SVN: r160034
2010-05-29cgraph.c (clone_function_name): Take SUFFIX argument; export.Jan Hubicka1-2/+4
* cgraph.c (clone_function_name): Take SUFFIX argument; export. (cgraph_create_virtual_clone): Take SUFFIX argument; udpate use of clone_function_name. * cgraph.h (cgraph_create_virtual_clone, cgraph_function_versioning): update prototypes. (clone_function_name): Declare. * ipa-cp.c (ipcp_insert_stage): Update call of cgraph_create_virtual_clone. * omp-low.c (create_omp_child_function_name): Use cgraph_create_virtual_clone. * cgraphunit.c (cgraph_copy_node_for_versioning): Fix edges updating. (cgraph_function_versioning): Take SUFFIX argument; produce new name and make decl local. * gcc.dg/tree-ssa/ipa-cp-1.c: Update testcase. From-SVN: r160016
2010-05-27cgraph.h (struct cgraph_node): Mark former_clone_of by GTY ((skip)).Jan Hubicka1-2/+3
* cgraph.h (struct cgraph_node): Mark former_clone_of by GTY ((skip)). * cgraphunit.c (clone_of_p): Compile only when checking is enabled. From-SVN: r159925
2010-05-27cgraphunit.c (verify_cgraph_node): Do checking that DECL match edge only ↵Jan Hubicka1-0/+4
when checking is enabled... * cgraphunit.c (verify_cgraph_node): Do checking that DECL match edge only when checking is enabled; check using former_clone_of; check inline clones too. (cgraph_materialize_clone): Record former_clone_of pointer. (cgraph_redirect_edge_call_stmt_to_callee): Assert that we are not combining redirections; dump args_to_skip bitmap (cgraph_materialize_all_clones): Do no redirection here. * ipa-inline.c (inline_transform): Do redirection here. * cgraph.h (struct cgraph_node): Add former_clone_of filed (enabled cheking only). From-SVN: r159907
2010-05-22coretypes.h (struct simple_bitmap_def, [...]): New core types.Steven Bosscher1-1/+5
gcc/ChangeLog: * coretypes.h (struct simple_bitmap_def, sbitmap, const_sbitmap): New core types. * sbitmap.h (struct sbitmap_def): Do not typedef here. * sbitmap.c: Include sbitmap.h. * basic-block.h: Do not include bitmap.h, sbitmap.h, partition.h, hard-reg-set.h. Split everything related to regsets out from here... * regset.h: ...to here. New file. * df.h: Include regset.h and sbitmap.h. * tree-flow.h: Likewise. * cfgloop.h: Likewise. * except.h: Do not include sbitmap.h. Include hashtab.h. * cgraph.h: Include vec.h and function.h. * reload.h (struct insn_chain): Change types of live_throughout and dead_or_set from regset_head to bitmap_head. (compute_use_by_pseudos): Be defined also if regset.h is not included. * ira-int.h (struct ira_spilled_reg_stack_slot): Change type of spilled_regs from regset_head to bitmap_head to avoid dependency in regset.h. * sel-sched-ir.h: Include regset.h. * reload.c: Include df.h before reload.h. * caller-save.c: Likewise. * reload1.c: Likewise. * ira.c: Likewise. (mark_elimination): Update type of r to bitmap, consistent with DF_LR_IN. * dominance.c: Include bitmap.h. * modulo-sched.c: Include df.h. * cfganal.c: Include bitmap.h and sbitmap.h. * cfgbuild.c: Include sbitmap.h. * lcm.c: Include sbitmap.h. * gcse.c (alloc_gcse_mem): Allocate regset with ALLOC_REG_SET. * domwalk.c: Include sbitmap.h, exclude ggc.h. * cfgexpand.c: Inlcude bitmap.h and sbitmap.h. * cselib.c: Include bitmap.h. * tree-optimize.c: Include regset.h. * stmt.c: Include bitmap.h. * Makefile.in: Update dependencies. cp/ChangeLog * semantics.c: Include bitmap.h. * Make-lang.in: Update dependencies. From-SVN: r159746
2010-05-22decl2.c (maybe_emit_vtables): Produce same comdat group when outputting ↵Jan Hubicka1-0/+2
comdat vtables. * decl2.c (maybe_emit_vtables): Produce same comdat group when outputting comdat vtables. (cxx_callgraph_analyze_expr): Remove code marking vtables needed. * cgraph.h (struct varpool_node): Add same_comdat_group. * lto-cgrpah.c (lto_output_varpool_node): Output same_comdat_group pointer. (output_varpool): Update call of lto_output_varpool_node. (input_varpool): Read same_comdat_group pointer. (input_varpool_1): Fixup same_comdat_group pointer. * ipa.c (cgraph_remove_unreachable_nodes): WHen one of same comdat group is needed, all are. * varpool.c (varpool_remove_node): Remove node from same comdat group linklist too. (varpool_analyze_pending_decls): Walk same comdat groups. From-SVN: r159699
2010-05-17cgraph.h (struct ipa_replace_map): Add parm_num parameter.Jan Hubicka1-0/+2
* cgraph.h (struct ipa_replace_map): Add parm_num parameter. * lto-cgraph.c (output_cgraph_opt_summary, input_cgraph_opt_summary): New functions. (output_cgraph): Call output_cgraph_opt_summary. (input_cgrpah): Call input_cgraph_opt_summary. (output_cgraph_opt_summary_p, output_node_opt_summary, input_node_opt_summary, input_cgraph_opt_section): New functions. * lto-section-in.c (lto_section_name): Add cgraphopt. * tree-inline.c (tree_function_versioning): Handle parm_num. * lto-streamer.c (lto_get_section_name): Handle cgraphopt. * lto-streamer.h (lto_section_type): Add LTO_section_cgraph_opt_sum. From-SVN: r159517
2010-05-17cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and ↵Martin Jambor1-0/+11
polymorphic. 2010-05-17 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_indirect_call_info): New fields anc_offset, otr_token and polymorphic. * cgraph.c (cgraph_create_indirect_edge): Inilialize the above fields. (cgraph_clone_edge): Copy the above fields. * tree.c (get_binfo_at_offset): New function. * tree.h (get_binfo_at_offset): Declare. * ipa-prop.h (enum jump_func_type): Added known_type jump function type, reordered items, updated comments. (union jump_func_value): Added base_type field, reordered fields. (enum ipa_lattice_type): Moved down in the file. (struct ipa_param_descriptor): New field polymorphic. (ipa_is_param_polymorphic): New function. * ipa-prop.c: Include gimple.h and gimple-fold.h. (ipa_print_node_jump_functions): Print known type jump functions. (compute_complex_pass_through): Renamed to... (compute_complex_assign_jump_func): this. (compute_complex_ancestor_jump_func): New function. (compute_known_type_jump_func): Likewise. (compute_scalar_jump_functions): Create known type and complex ancestor jump functions. (ipa_note_param_call): New parameter polymorphic, set the corresponding flag in the call note accordingly. (ipa_analyze_call_uses): Renamed to... (ipa_analyze_indirect_call_uses): this. New parameter target, define variable var only in the block where it is used. (ipa_analyze_virtual_call_uses): New function. (ipa_analyze_call_uses): Likewise. (combine_known_type_and_ancestor_jfs): Likewise. (update_jump_functions_after_inlining): Implemented handling of a number of new jump function types combination. (print_edge_addition_message): Removed. (make_edge_direct_to_target): New function. (try_make_edge_direct_simple_call): Likewise. (try_make_edge_direct_virtual_call): Likewise. (update_call_notes_after_inlining): Renamed to... (update_indirect_edges_after_inlining): this. Moved edge creation for indirect calls to try_make_edge_direct_simple_call, also calls try_make_edge_direct_virtual_call for virtual calls. (ipa_print_node_params): Changed the header message. (ipa_write_jump_function): Stream also known type jump functions. (ipa_read_jump_function): Likewise. (ipa_write_indirect_edge_info): Stream new fields in cgraph_indirect_call_info. (ipa_read_indirect_edge_info): Likewise. * Makefile.in (ipa-prop.o): Add dependency to GIMPLE_H and GIMPLE_FOLD_H. * testsuite/g++.dg/ipa/ivinline-1.C: New test. * testsuite/g++.dg/ipa/ivinline-2.C: New test. * testsuite/g++.dg/ipa/ivinline-3.C: New test. * testsuite/g++.dg/ipa/ivinline-4.C: New test. * testsuite/g++.dg/ipa/ivinline-5.C: New test. * testsuite/g++.dg/ipa/ivinline-6.C: New test. From-SVN: r159507
2010-05-16cgraph.c (dump_cgraph_node): Dump versionable flag.Jan Hubicka1-0/+4
* cgraph.c (dump_cgraph_node): Dump versionable flag. * cgraph.h (cgraph_local_info): Add versionable flag. * ipa-cp.c (ipcp_analyze_node): Set versionable flag. (ipcp_versionable_function_p): Use it. * lto-cgraph.c (lto_output_node, input_overwrite_node): Stream versionable flag. From-SVN: r159467
2010-05-16cgraph.c (cgraph_clone_node): Take decl argument and insert clone into hash ↵Jan Hubicka1-1/+1
when it is different from orig. * cgraph.c (cgraph_clone_node): Take decl argument and insert clone into hash when it is different from orig. (cgraph_create_virtual_clone): Update use of cgraph_clone_node. * cgraph.h (cgraph_clone_node): Update prototype. * lto-cgrpah.c (lto_cgraph_encoder_new): Create body map. (lto_cgraph_encoder_delete): Delete body map. (lto_cgraph_encoder_size): Move to header. (lto_cgraph_encoder_encode_body_p, lto_set_cgraph_encoder_encode_body): New. (lto_output_node): Do not take written_decls argument; output clone_of pointer. (add_node_to): Add include_body_argument; call lto_set_cgraph_encoder_encode_body on master of the clone. (add_references): Update use of add_node_to. (compute_ltrans_boundary): Likewise. (output_cgraph): Do not create written_decls bitmap. (input_node): Take nodes argument; stream in clone_of correctly. (input_cgraph_1): Update use of input_node. * lto-streamer-out.c (lto_output): Use encoder info to decide what bodies to output. * ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_decide_recursive_inlining): Update call of cgraph_clone_node. * lto-streamer.h (lto_cgraph_encoder_d): Add body. (lto_cgraph_encoder_size): Define here. (lto_cgraph_encoder_encode_body_p, lto_varpool_encoder_encode_body_p): Declare. From-SVN: r159466
2010-05-14cgraph.h (ipa_discover_readonly_nonaddressable_vars): Declare.Jan Hubicka1-0/+14
* cgraph.h (ipa_discover_readonly_nonaddressable_vars): Declare. (varpool_all_refs_explicit_p): New inline function. * ipa-reference.c: Update comment. (module_statics_written): Remove. (get_static_decl): Remove. (ipa_init): Do not initialize module_statics_written. (analyze_function): Likewise. (generate_summary): Likewise; do not compute module_statics_readonly and do not update variable flags. (propagate): Call ipa_discover_readonly_nonaddressable_vars. * ipa.c: Inlucde flags.h (cgraph_local_node_p): New. (cgraph_remove_unreachable_nodes): Return early when not optimizing; promote functions to local. (ipa_discover_readonly_nonaddressable_vars): New function. (function_and_variable_visibility): Use cgraph_local_node_p. * varpool.c (varpool_finalize_decl): Set force_output for DECL_PRESERVE_P vars. From-SVN: r159421
2010-05-13cgraph.c (cgraph_mark_address_taken_node): No longer imply needed flag.Jan Hubicka1-2/+11
* cgraph.c (cgraph_mark_address_taken_node): No longer imply needed flag. * cgraph.h (cgraph_only_called_directly_p, cgraph_can_remove_if_no_direct_calls_p): test address_taken flag. (cgraph_can_remove_if_no_direct_calls_and_refs_p): New function. * cgraphunit.c (cgraph_mark_functions_to_output): Test address_taken. (assemble * ipa.c (cgraph_remove_unreachable_nodes): Use cgraph_can_remove_if_no_direct_calls_and_refs_p; clear address_taken flags. * tree-inline.c (copy_bb): Check address_taken flag. * tree-profile.c (tree_gen_ic_func_profiler): Check address_taken and externally_visible flag. * tree-ssa/unreachable.c: New test. From-SVN: r159354
2010-05-12cgraphbuild.c (build_cgraph_edges, [...]): Build indrect edges too.Jan Hubicka1-1/+3
* cgraphbuild.c (build_cgraph_edges, rebuild_cgraph_edges): Build indrect edges too. * cgraph.c (cgraph_create_indirect_edge): Take ecf_flags argument. (cgraph_clone_edge): Update. (cgraph_node_remove_callees): Remove indirect calls too. * cgraph.h (cgraph_indirect_call_info): Add ecf_flags. (cgraph_create_indirect_edge): Update prototype. * ipa-reference.c (has_proper_scope_for_analysis): Rename to is_proper_for_analysis. (add_new_function, visited_nodes, function_insertion_hook_holder, get_local_reference_vars_info, mark_address_taken, mark_address, mark_load, mark_store, check_asm_memory_clobber, check_call, scan_stmt_for_static_refs, scan_initializer_for_static_refs): Remove. (ipa_init): Do not initialize visited_nodes; function_insertion_hook_holder. (analyze_variable): Rewrite. (analyze_function): Rewrite. (copy_local_bitmap): Remove. (duplicate_node_dat): Do not duplicate local info. (generate_summary): Simplify to only walk cgraph. (write_node_summary_p, ipa_reference_write_summary, ipa_reference_read_summary): Remove. (propagate): Do not remove function insertion; generate summary. (pass_ipa_reference): NULLify summary handling fields. * lto-cgraph.c (lto_output_edge): Output ecf_flags. (input_edge): Input ecf_flags. * ipa-prop.c (ipa_note_parm_call): Expect edge to be around. (update_indirect_edges_after_inlining): Ignore edges with unknown param. From-SVN: r159343
2010-05-12cgraph.h (struct varpool_node): Add aux.Jan Hubicka1-0/+2
* cgraph.h (struct varpool_node): Add aux. * varasm.c (find_decl_and_mark_needed): Force output of varpool nodes. * varpool.c (varpool_remove_node): Do not remove initializer. (varpool_reset_queue): Export. (varpool_finalize_decl): Volatile vars are forced to be output. * lto-symtab.c (lto_varpool_replace_node): Clear out initializer of replaced decl. * ipa.c (enqueue_cgraph_node, enqueue_varpool_node, process_references, varpool_can_remove_if_no_refs): New functions. (cgraph_remove_unreachable_nodes): Handle variables too. From-SVN: r159321
2010-05-11cgraphbuild.c (cgraph_rebuild_references): New.Jan Hubicka1-0/+1
* cgraphbuild.c (cgraph_rebuild_references): New. (cgraph_mark_reachable_node): Accept references to optimized out extern inlines. * cgraph.h (cgraph_rebuild_references): Declare. * tree-inline.c (tree_function_versioning): Use it. * ipa-struct-reorg.c (do_reorg_for_func): Likewise. From-SVN: r159259
2010-05-06cgraphbuild.c (record_reference_ctx): Add varpool_node.Jan Hubicka1-1/+6
* cgraphbuild.c (record_reference_ctx): Add varpool_node. (record_reference, mark_address, mark_load, mark_store): Record references. (record_references_in_initializer): Update call of record_references. (rebuild_cgraph_edges): Remove all references before rebuiding. * cgraph.c (cgraph_create_node): Clear ref list. (cgraph_remove_node): Remove references. (dump_cgraph_node): Dump references. (cgraph_clone_node): Clone references. * cgraph.h: Include ipa-ref.h and ipa-ref-inline.h (struct cgraph_node, varpool_node): Add ref_lst. * ipa-ref.c: New file. * ipa-ref.h: New file. * ipa-ref-inline.h: New file. * lto-cgraph.c (output_varpool): Take cgrag node set argument. (referenced_from_other_partition_p): New function. (lto_output_varpool_node): Take set arugment; call referenced_from_other_partition. (lto_output_ref): New. (add_references): New. (output_refs): New. (output_cgraph): Compute boundary based on references; output refs. (output_varpool): Accept cgraph_node_set argument. (input_ref): New. (input_refs): New. (input_cgraph): Call input_refs. * lto-section-in.c (lto_section_name): Add refs. * Makefile.in: (cgraph.h): Include ipa-ref.h and ipa-ref-inline.h (ipa-ref.o): New file. * varpool.c (varpool_node): Clear ipa ref list. (varpool_remove_node): Remove references. (dump_varpool_node): Dump references. (varpool_assemble_decl): Only compile finalized ones. (varpool_extra_name_alias): Initialize ref list. * lto-streamer.c (lto-get_section_name): Add .refs section. * lto-streamer.h (lto_section_type): Add LTO_section_refs. (referenced_from_other_partition_p): Declared. From-SVN: r159097
2010-04-30lto.c (get_filename_for_set): Look for cgraph node and if none found, use ↵Jan Hubicka1-0/+14
default name. * lto.c (get_filename_for_set): Look for cgraph node and if none found, use default name. (lto_wpa_write_files): Write any non-empty partition. * cgraph.h (cgraph_node_set_nonempty_p, varpool_node_set_nonempty_p): New. * lto-cgraph.c (input_cgraph): Remove call to lto_mark_file_for_ltrans. * lto-streamer.h (lto_file_decl_data): Remove needs_ltrans_p. (lto_file_needs_ltrans_p, lto_mark_file_for_ltrans, cgraph_node_set_needs_ltrans_p): Remove. From-SVN: r158943
2010-04-30cgraph.h (cgraph_local_info): Remove for_functions_valid.Jan Hubicka1-25/+0
* cgraph.h (cgraph_local_info): Remove for_functions_valid. (cgraph_global_info): Remove inlined. (LTO_cgraph_tag_names): Remove. (LTO_cgraph_tags, LCC_NOT_FOUND): Move to ... * lto-cgraph.c (LTO_cgraph_tags, LCC_NOT_FOUND): ... here; simplify cgraph tags and document. (lto_output_node): Use only LTO_cgraph_unavail_node and LTO_cgraph_analyzed_node; Do not save analzed, reachable, for_functions_valid, global info, process and output flags. (input_overwrite_node): Initialize estimated stack size and estimated growth. Do not read flags we no longer store. (input_node): Likewise do not read info no longer stored. * ipa-inline.c (cgraph_mark_inline_edge): Do not set global.inlined flag. From-SVN: r158926
2010-04-29gengtype.c (open_base_files): Add lto-streamer.hJan Hubicka1-1/+1
* gengtype.c (open_base_files): Add lto-streamer.h * cgraph.h (cgraph_local_info): lto_file_data is now in GGC. (pass_ipa_cp): GGC collect. * toplev. (compile_file): Do not output symbols. * ipa-inline.c (pass_ipa_inline): Add ggc collect. * timevar.def (TV_VARPOOL, TV_IPA_LTO_DECL_INIT_IO, TV_IPA_LTO_DECL_MERGE, TV_IPA_LTO_CGRAPH_MERGE, TV_VAROUT): New. * lto-section-in.c: Include ggc.h (lto_new_in_decl_state): Alloc in GGC. (lto_delete_in_decl_state): Likewise. * ipa.c (pass_ipa_function_visibility, pass_ipa_whole_program): Collect. * lto/lto.c (lto_read_in_decl_state): Use GGC. (lto_wpa_write_files): Announce what we are writting. (all_file_decl_data): New. (read_cgraph_and_symbols): Use GGC; correct timevars. (do_whole_program_analysis): Collect. * lto/Make-lang.in (lto.o): Fix dependency. * Makefile.in (GTFILES): Add lto-streamer.h. * varpool.c (varpool_analyze_pending_decls): Use TV_VARPOOL. (varpool_assemble_pending_decls): Use VAROUT. * lto-streamer.h (lto_tree_ref_table): Annotate. (lto_in_decl_state): Annotate. (lto_file_decl_data): Annotate. From-SVN: r158912
2010-04-29* lto-symtab.c (lto_symtab_entry_def) Add vnode.Jan Hubicka1-3/+104
(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-28cgraph.h (struct cgraph_node): New field indirect_calls.Martin Jambor1-3/+24
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-27cgraph.c (cgraph_propagate_frequency): New function.Jan Hubicka1-0/+1
* cgraph.c (cgraph_propagate_frequency): New function. * cgraph.h (cgraph_propagate_frequency): Declare. * ipa-inline.c (cgraph_clone_inlined_nodes): Call cgraph_propagate_frequency. * testsuite/gcc.dg/ipa/iinline-1.c (main): Rename to... (test): ... this one. From-SVN: r158775
2010-04-26cgraph.c (cgraph_create_node): Set node frequency to normal.Jan Hubicka1-0/+18
* cgraph.c (cgraph_create_node): Set node frequency to normal. (cgraph_clone_node): Copy function frequency. * cgraph.h (node_frequency): New enum (struct cgraph_node): Add. * final.c (rest_of_clean_state): Update. * lto-cgraph.c (lto_output_node): Output node frequency. (input_overwrite_node): Input node frequency. * tre-ssa-loop-ivopts (computation_cost): Update. * lto-streamer-out.c (output_function): Do not output function frequency. * predict.c (maybe_hot_frequency_p): Update and handle functions executed once. (cgraph_maybe_hot_edge_p): Likewise; use cgraph frequency instead of attribute lookup. (probably_never_executed_bb_p, optimize_function_for_size_p): Update. (compute_function_frequency): Set noreturn functions to be executed once. (choose_function_section): Update. * lto-streamer-in.c (input_function): Do not input function frequency. * function.c (allocate_struct_function): Do not initialize function frequency. * function.h (function_frequency): Remove. (struct function): Remove function frequency. * ipa-profile.c (CGRAPH_NODE_FREQUENCY): Remove. (try_update): Update. * tree-inline.c (initialize_cfun): Do not update function frequency. * passes.c (pass_init_dump_file): Update. * i386.c (ix86_compute_frame_layout): Update. (ix86_pad_returns): Update. From-SVN: r158732
2010-04-20cgraph.c (cgraph_remove_node): Kill bodies in other partitoin.Jan Hubicka1-1/+5
* cgraph.c (cgraph_remove_node): Kill bodies in other partitoin. (dump_cgraph_node): Dump new flags. * cgraph.h (struct cgraph_node): Add flags reachable_from_other_partition and in_other_partition. (cgraph_can_remove_if_no_direct_calls_p): Functions used by other partition can not be removed. * cgraphunit.c (cgraph_mark_functions_to_output): Functions used by the other partition must be output; silence sanity checking on leaking functions bodies from other paritition. * lto-cgraph.c (reachable_from_other_partition_p): New function. (lto_output_node): Output new flags; do not sanity check that inline clones are output; drop lto_forced_extern_inline_p code; do not mock visibility flags at partition boundaries. (add_node_to): New function. (output_cgraph): Use it to sort functions so masters appear before clones. (input_overwrite_node): Input new flags. * passes.c (ipa_write_summaries): Do not call lto_new_extern_inline_states. * lto-section-out.c (forced_extern_inline, lto_new_extern_inline_states, lto_delete_extern_inline_states, lto_force_functions_extern_inline, lto_forced_extern_inline_p): Kill. * lto-streamer.h (lto_new_extern_inline_states, * lto_delete_extern_inline_states, lto_force_functions_extern_inline, lto_forced_extern_inline_p): Kill. * lto.c (lto_add_inline_clones): Do not track inlined_decls. (lto_add_all_inlinees): Likewise. (lto_wpa_write_files): Likewise. From-SVN: r158563
2010-04-02Make-lang.in, [...]: Update copyright years.Steven Bosscher1-1/+1
* ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h, collect2.h, config/alpha/alpha.c, config/alpha/alpha.md, config/alpha/predicates.md, config/arm/arm.md, config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c, config/darwin9.h, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h, config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c, config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c, config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c, config/mips/mips.md, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md, config/rs6000/aix.h, config/rs6000/dfp.md, config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c, config/rs6000/vector.md, config/rtems.h, config/rx/rx.md, config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h, config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md, config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c, config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in, c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c, diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi, doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi, doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c, fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h, gensupport.c, gimple.h, gimple-iterator.c, graphite.c, graphite-clast-to-gimple.c, graphite-clast-to-gimple.h, graphite-dependences.c, graphite-poly.c, graphite-poly.h, graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c, graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c, intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h, ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c, ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c, loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c, objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk, opt-functions.awk, opth-gen.awk, params.def, passes.c, postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h, rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h, store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c, tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h, tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c, tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c, unwind-dw2-fde-darwin.c, varpool.c: Update copyright years. From-SVN: r157950
2010-03-18re PR middle-end/42450 (another GCC 4.5 ICE on C++ templated code)Martin Jambor1-1/+1
2010-03-18 Martin Jambor <mjambor@suse.cz> PR middle-end/42450 * cgraph.h (cgraph_redirect_edge_call_stmt_to_callee): Declare. * cgraphunit.c (cgraph_materialize_all_clones): Update calls in all non-clones. Moved call redirection... (cgraph_redirect_edge_call_stmt_to_callee): ...to this new function. (cgraph_materialize_all_clones): Dispose of all combined_args_to_skip bitmaps. (verify_cgraph_node): Do not check for edges pointing to wrong nodes in inline clones. * tree-inline.c (copy_bb): Call cgraph_redirect_edge_call_stmt_to_callee. * ipa.c (cgraph_remove_unreachable_nodes): Call cgraph_node_remove_callees even when there are used clones. * testsuite/g++.dg/torture/pr42450.C: New test. From-SVN: r157546
2010-03-03re PR c++/12909 (ambiguity in mangling vector types)Jason Merrill1-1/+6
PR c++/12909 * cgraph.h (varpool_node): Add extra_name field. * varpool.c (varpool_extra_name_alias): New. (varpool_assemble_decl): Emit extra name aliases. (varpool_mark_needed_node): Look past an extra name alias. cp/ * mangle.c (mangle_decl): Handle VAR_DECL, too. From-SVN: r157203
2010-02-20re PR middle-end/42344 (ICE in rs6000.md with ipa-sra for 252.eon)Alan Modra1-0/+1
PR middle-end/42344 * cgraph.h (cgraph_make_decl_local): Declare. * cgraph.c (cgraph_make_decl_local): New function. (cgraph_make_node_local): Use it. * cgraphunit.c (cgraph_function_versioning): Likewise. * ipa.c (function_and_variable_visibility): Likewise. From-SVN: r156914
2009-12-14cgraph.h (cgraph_set_nothrow_flag, [...]): New prototypes.Jakub Jelinek1-0/+5
* cgraph.h (cgraph_set_nothrow_flag, cgraph_set_readonly_flag, cgraph_set_pure_flag, cgraph_set_looping_const_or_pure_flag): New prototypes. * cgraph.c (cgraph_set_nothrow_flag, cgraph_set_readonly_flag, cgraph_set_pure_flag, cgraph_set_looping_const_or_pure_flag): New functions. * except.h (set_nothrow_function_flags): Remove prototype. * except.c (set_nothrow_function_flags): Use cgraph_set_nothrow_flag. Make static. * ipa-pure-const.c (propagate): Use cgraph_set_nothrow_flag, cgraph_set_readonly_flag, cgraph_set_pure_flag and cgraph_set_looping_const_or_pure_flag. (local_pure_const): Likewise. From-SVN: r155220
2009-12-10re PR c++/42317 (Issues with comdat virtual dtors)Jakub Jelinek1-0/+2
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-10re PR middle-end/42228 (verify_cgraph_node failed:node has wrong clone_of)Jan Hubicka1-1/+1
PR middle-end/42228 PR middle-end/42110 * cgraph.c (cgraph_create_edge_including_clones): Add old_stmt parameter; update edge if it already exists. (cgraph_remove_node): Handle correctly cases where we are removing node having clones. * cgraph.h (cgraph_create_edge_including_clones): Declare. (verify_cgraph_node): Add missing error_found = true code. (cgraph_materialize_all_clones): Remove call edges of dead nodes. * ipa.c (cgraph_remove_unreachable_nodes): Correctly look for master clone; fix double linked list removal. * tree-inline.c (copy_bb): Update cgraph_create_edge_including_clones call; fix frequency of newly created edge. * g++.dg/torture/pr42110.C: new file. From-SVN: r155140
2009-12-01cgraph.h (struct cgraph_edge): Reorder fields.Martin Jambor1-8/+8
2009-12-01 Martin Jambor <mjambor@suse.cz> * cgraph.h (struct cgraph_edge): Reorder fields. Make loop_nest unsigned short int. * ipa-prop.h (struct ipa_param_call_note): Likewise. * ipa-prop.c (ipa_note_param_call): Initialize note->loop_nest. From-SVN: r154872
2009-11-29cgraph.c (same_body_alias_1): Break out ofJan Hubicka1-4/+19
* cgraph.c (same_body_alias_1): Break out of (same_body_alias): ... here; remove comdat check; it is handled in cp already. (cgraph_add_thunk): New. (dump_cgraph_node): Dump aliases and thunks. * cgraph.h (cgraph_thunk_info): New structure. (struct cgraph_node): Add thunk info. (cgraph_add_thunk): New. * cgraphunit.c (cgraph_emit_thunks): Remove. (cgraph_finalize_compilation_unit): Do not call cgraph_emit_thunks. (assemble_thunk): New function. (cgraph_expand_function): Handle thunks. (thunk_adjust): New. (init_lowered_empty_function): New. * optimize.c (maybe_clone_body): Emit thunks associated to alias. * Make-lang.in (method.o): Add dependency on gimple.h. * method.c: Include gimple.h (make_alias_for_thunk): Use same body alias instead of assemble_alias. (use_thunk): Drop codegen; use cgraph_add_thunk; gimplify generic thunks. * semantics.c (expand_or_defer_fn): Emit associated thunks. * cp-objcp-common.h (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Remove. * lto-cgraph.c (lto_output_node): Stream thunk info. (input_node): Likewise. * langhooks.h (lang_hooks_for_callgraph): Remove emit_associated_thunks. * langhooks-def.h (LANG_HOOKS_CALLGRAPH_EMIT_ASSOCIATED_THUNKS): Remove. (LANG_HOOKS_CALLGRAPH_INITIALIZER): Update. * i386.c (x86_output_mi_thunk): Make output prettier. From-SVN: r154736
2009-11-25Remove trailing white spaces.H.J. Lu1-3/+3
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-19tree.c (need_assembler_name_p): Use cgraph_get_node instead of ↵Jakub Jelinek1-1/+0
cgraph_node_for_decl. * tree.c (need_assembler_name_p): Use cgraph_get_node instead of cgraph_node_for_decl. * cgraph.h (cgraph_node_for_decl): Remove prototype. * cgraph.c (cgraph_node_for_decl): Remove. (cgraph_get_node): Just return NULL if !cgraph_hash. From-SVN: r154329
2009-11-18re PR c++/3187 (gcc lays down two copies of constructors)Jakub Jelinek1-0/+8
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-16cgraph.c (cgraph_release_function_body): Update use of ipa_transforms_to_apply.Jan Hubicka1-4/+17
* cgraph.c (cgraph_release_function_body): Update use of ipa_transforms_to_apply. (cgraph_remove_node): Remove ipa_transforms_to_apply. * cgraph.h (struct cgraph_node): Add ipa_transforms_to_apply. * cgraphunit.c (save_inline_function_body): Clear ipa_transforms for copied body. (cgraph_materialize_clone): Remove original if dead. * lto-streamer-in.c (lto_read_body): Remove FIXME and ipa_transforms_to_apply hack. * function.h (struct function): Add ipa_transforms_to_apply. * ipa.c (cgraph_remove_unreachable_nodes): Handle dead clone originals. * tree-inline.c (copy_bb): Update sanity check. (initialize_cfun): Do not copy ipa_transforms_to_apply. (expand_call_inline): remove dead clone originals. (tree_function_versioning): Merge transformation queues. * passes.c (add_ipa_transform_pass): Remove. (execute_one_ipa_transform_pass): Update ipa_transforms_to_apply tracking. (execute_all_ipa_transforms): Update. (execute_one_pass): Update. * lto.c (read_cgraph_and_symbols): Set also ipa_transforms_to_apply. From-SVN: r154200
2009-11-12cgraph.h (varpool_node_name): Declare.Jan Hubicka1-0/+1
* cgraph.h (varpool_node_name): Declare. * cgraphunit.c (process_function_and_variable_attributes): Set force_output flag on used variables. * ipa.c (function_and_variable_visibility): Dump externally visible and needed variables. * varpool.c (varpool_node_name): Export. (decide_is_variable_needed): Check COMDAT for externally visible vars; ignore needed flag. From-SVN: r154121
2009-10-08Fix 41626 from Jan HubickaJan Hubicka1-1/+1
From-SVN: r152569
2009-10-07lto-symtab.c (lto_cgraph_replace_node): Assert that inline clones has no ↵Jan Hubicka1-0/+20
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-03Merge lto branch into trunk.Diego Novillo1-2/+34
From-SVN: r152434
2009-10-01cgraph.c (cgraph_clone_node): Add redirect_callers parameter.Jan Hubicka1-1/+1
* cgraph.c (cgraph_clone_node): Add redirect_callers parameter. (cgraph_create_virtual_clone): Just pass redirect_callers around. * cgraph.h (cgraph_clone_node): Update prototype. * ipa-pure-const.c (self_recursive_p): New function. (propagate): Use it. * ipa-inline.c (cgraph_clone_inlined_nodes, * cgraph_decide_recursive_inlining): Update. * gcc.dg/tree-ssa/ipa-cp-1.c: New testcase. From-SVN: r152388