* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158943 138bc75d-0d04-0410-961f-82ee72b054a4
* lto-cgraph.c (lto_output_varpool_node): Always output constant pool references. * lto.c: Do not attempt to make constant pool references global. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158938 138bc75d-0d04-0410-961f-82ee72b054a4
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158912 138bc75d-0d04-0410-961f-82ee72b054a4
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158854 138bc75d-0d04-0410-961f-82ee72b054a4
ChangeLog: PR lto/42776 * configure.ac (--enable-lto): Refactor handling so libelf tests are only performed inside then-clause of ACX_ELF_TARGET_IFELSE, and allow LTO to be explicitly enabled on non-ELF platforms that are known to support it inside else-clause. * configure: Regenerate. gcc/ChangeLog: PR lto/42776 * configure.ac (gcc_cv_as_section_has_align): Set if installed binutils supports extended .section directive needed by LTO, or warn if older binutils found. (LTO_BINARY_READER): New AC_SUBST'd variable. (LTO_USE_LIBELF): Likewise. * gcc/config.gcc (lto_binary_reader): New target-specific configure variable. * gcc/Makefile.in (LTO_BINARY_READER): Import AC_SUBST'd autoconf var. (LTO_USE_LIBELF): Likewise. * configure: Regenerate. * collect2.c (is_elf): Rename from this ... (is_elf_or_coff): ... to this, and recognize and allow i386 COFF object files in addition to ELF-formatted ones. (scan_prog_file): Caller updated. Also allow for LTO info marker symbol to be prefixed or not by an extra underscore. * config/i386/t-cygming (winnt.o): Also depend on LTO_STREAMER_H. * config/i386/winnt.c: Also #include lto-streamer.h (i386_pe_asm_named_section): Specify 1-byte section alignment for LTO named sections. (i386_pe_asm_output_aligned_decl_common): Add comment. (i386_pe_maybe_record_exported_symbol): Allow decl arg to be NULL. gcc/lto/ChangeLog: PR lto/42776 * Make-lang.in (LTO_OBJS): Use LTO_BINARY_READER instead of hardcoding 'lto-elf.o'. ($(LTO_EXE)): Use LTO_USE_LIBELF instead of hardcoding '-lelf'. * lto-coff.h: New file. * lto-coff.c: Likewise. gcc/testsuite/ChangeLog: PR lto/42776 * lib/lto.exp (lto_prune_vis_warns): New function. (lto-link-and-maybe-run): Call it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158762 138bc75d-0d04-0410-961f-82ee72b054a4
2010-04-26 Richard Guenther <rguenther@suse.de> * lto.c (lto_fixup_type): Deal with non-type TYPE_CONTEXT. * gcc.dg/lto/20100426_0.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158729 138bc75d-0d04-0410-961f-82ee72b054a4
* lto.h (lto_elf_file_open): Rename prototype from this ... (lto_obj_file_open): ... to this. (lto_elf_file_close): Likewise ... (lto_obj_file_close): ... and likewise. (lto_elf_build_section_table): Likewise ... (lto_obj_build_section_table): ... and likewise. (lto_elf_begin_section): Likewise ... (lto_obj_begin_section): ... and likewise. (lto_elf_append_data): Likewise ... (lto_obj_append_data): ... and likewise. (lto_elf_end_section): Likewise ... (lto_obj_end_section): ... and likewise. * lto.c (lto_file_read): Update references to the above. (lto_wpa_write_files): Likewise. (lto_read_all_file_options): Likewise. (read_cgraph_and_symbols): Likewise. * lto-lang.c (LANG_HOOKS_BEGIN_SECTION): Likewise. (LANG_HOOKS_APPEND_DATA): Likewise. (LANG_HOOKS_END_SECTION): Likewise. * lto-elf.c (lto_elf_file_open): Rename from this ... (lto_obj_file_open): ... to this, updating any references. (lto_elf_file_close): Likewise ... (lto_obj_file_close): ... and likewise. (lto_elf_build_section_table): Likewise ... (lto_obj_build_section_table): ... and likewise. (lto_elf_begin_section): Likewise ... (lto_obj_begin_section): ... and likewise. (lto_elf_append_data): Likewise ... (lto_obj_append_data): ... and likewise. (lto_elf_end_section): Likewise ... (lto_obj_end_section): ... and likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158718 138bc75d-0d04-0410-961f-82ee72b054a4
* timevar.def (TV_WHOPR_WPA_FIXUP): Remove. * lto-section-in.c (lto_section_name): Remove wpa_fixup. * lto-wpa-fixup.c: Remove. * Makefile.in (lto-wpa-fixup.o): Remove. * passes.c (init_optimization_passes): Remove pass_ipa_lto_wpa_fixup. (execute_all_ipa_transforms): Set cgraph_state to CGRAPH_STATE_IPA_SSA. * lto-streamer.c (lto_get_section_name): Remove wpa_fixup section. * lto.c (lto_fixup_tree): Do not call wpa fixup. (materialize_cgraph): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158622 138bc75d-0d04-0410-961f-82ee72b054a4
* tree-pass.h (ipa_opt_pass_d): Rename function_read_summary; add write_optimization_summary, read_optimization_summary. (ipa_write_summaries_of_cgraph_node_set): Remove. (ipa_write_optimization_summaries): Declare. (ipa_read_optimization_summaries): Declare. * ipa-cp.c (pass_ipa_cp): Update. * ipa-reference.c (pass_ipa_reference): Update. * ipa-pure-const.c (pass_ipa_pure_const): Update. * lto-streamer-out.c (pass_ipa_lto_gimple, pass_ipa_lto_finish): Update. * ipa-inline.c (pass_ipa_inline): Update. * ipa.c (pass_ipa_whole_program): Update. * lto-wpa-fixup.c (pass_ipa_lto_wpa_fixup): Update. * passes.c (ipa_write_summaries_1): Do not test wpa. (ipa_write_optimization_summaries_1): New. (ipa_write_optimization_summaries): New. (ipa_read_summaries): Do not test ltrans. (ipa_read_optimization_summaries_1): New. (ipa_read_optimization_summaries): New. * lto.c (lto_wpa_write_files): Update. (read_cgraph_and_symbols): Be more verbose. (materialize_cgraph): Likewise. (do_whole_program_analysis): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158616 138bc75d-0d04-0410-961f-82ee72b054a4
* lto.c (globalize_cross_file_statics): When function has address taken, it needs to be public. * varpool.c (decide_is_variable_needed): Variable is always needed during ltrans. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158609 138bc75d-0d04-0410-961f-82ee72b054a4
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158563 138bc75d-0d04-0410-961f-82ee72b054a4
2010-04-18 Eric Botcazou <ebotcazou@adacore.com> * fold-const.c (fold_comparison): Use ssizetype. * gimple-fold.c (maybe_fold_offset_to_array_ref): Likewise. * ipa-prop.c (ipa_modify_call_arguments): Use sizetype. * tree-loop-distribution.c (build_size_arg_loc): Likewise. * tree-object-size.c (compute_object_sizes): Use size_type_node. * tree.h (initialize_sizetypes): Remove parameter. (build_common_tree_nodes): Remove second parameter. * stor-layout.c (initialize_sizetypes): Remove parameter. Always create an unsigned type. (set_sizetype): Assert that the passed type is unsigned and simplify. * tree.c (build_common_tree_nodes): Remove second parameter. Adjust call to initialize_sizetypes. * c-decl.c (c_init_decl_processing): Remove second argument in call to build_common_tree_nodes. cp/ * decl.c (cxx_init_decl_processing): Remove second argument in call to build_common_tree_nodes. java/ * decl.c (java_init_decl_processing): Remove argument in call to initialize_sizetypes fortran/ * f95-lang.c (gfc_init_decl_processing): Remove second argument in call to build_common_tree_nodes. ada/ * gcc-interface/misc.c (gnat_init): Remove second argument in call to build_common_tree_nodes. lto/ * lto-lang.c (lto_init): Remove second argument in call to build_common_tree_nodes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158496 138bc75d-0d04-0410-961f-82ee72b054a4
toplevel: * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx separately. * configure: Regenerate. gcc: * configure.ac: Check for elf_getshdrstrndx or elf_getshstrndx flavor. * configure: Regenerate. * config.in: Regenerate. * doc/install.texi (Prerequisites): Document that Solaris 2 libelf works. gcc/lto: * lto-elf.c [!HAVE_ELF_GETSHDRSTRNDX] (elf_getshdrstrndx): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158423 138bc75d-0d04-0410-961f-82ee72b054a4
* cgraph.c (cgraph_create_virtual_clone): Only check versionable_function_p when not in wpa and checking is enabled. * cgrpahunit.c (cgraph_materialize_all_clones): Stabilize after there are no more functions to materialize. * lto/lto.c (lto_1_to_1_map): Partition non-inline clones. (lto_promote_cross_file_statics): Deal with non-inline clones. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159518 138bc75d-0d04-0410-961f-82ee72b054a4
* lto.c (lto_materialize_function): Announce function when reading body; allocate_struct_function only when reading body; do not finalize local statics; ggc_collect after reading; do not mark reachable node. (materialize_cgraph): Do not announce function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159516 138bc75d-0d04-0410-961f-82ee72b054a4
* lto.c (materialize_cgraph): Revert my previous patch. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159305 138bc75d-0d04-0410-961f-82ee72b054a4
2010-05-11 Kai Tietz <kai.tietz@onevision.com> * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Rename to IMAGE_FILE_MACHINE_AMD64. * lto-coff.c (IMAGE_FILE_MACHINE_ADM64): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159290 138bc75d-0d04-0410-961f-82ee72b054a4
* lto.c (lto_fixup_decls): Remove global var decls freeing here. (materialize_cgraph): Add it here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159281 138bc75d-0d04-0410-961f-82ee72b054a4
* lto-symtab.c (lto_symtab_free): New function. * lto-streamer.h (lto_symtab_free): Declare. * lto-cgraph.c (reachable_from_other_partition_p): Export; do not assume that if function is needed it is reachable. (lto_output_node): See if it the function is reachable or referenced. (output_cgraph): Update call of lto_output_node. * lto-streamer.h (reachable_from_other_partition_p): Declare. * lto.c (lto_fixup_decls): Free no longer needed lto_global_var_decls vector. * lto.c (lto_1_to_1_map): Remove some no longer needed checks. (lto_promote_cross_file_statics): Never promote DECL_EXTERNAL; use reachable_from_other_partition_p and referenced_from_other_partition_p test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159280 138bc75d-0d04-0410-961f-82ee72b054a4
2010-05-11 Kai Tietz <kai.tietz@onevision.com> * lto-coff.c (validate_file): Add x64-coff support. * lto-coff.h (IMAGE_FILE_MACHINE_ADM64): New. (COFF_KNOWN_MACHINES): Add IMAGE_FILE_MACHINE_ADM64. * lto-lang.c (lto_build_c_type_nodes): Add check for 'long long unsigned int' for x64-windows. (lto_init): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159271 138bc75d-0d04-0410-961f-82ee72b054a4