aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
AgeCommit message (Collapse)AuthorFilesLines
2012-01-06re PR lto/51774 (FAIL: gcc.dg/lto/trans-mem-* ↵Jakub Jelinek2-1/+25
c_lto_trans-mem-1_0.o-c_lto_trans-mem-1_1.o link, -flto -fgnu-tm) PR lto/51774 * lto-lang.c (handle_returns_twice_attribute): New function. (lto_attribute_table): Add returns_twice attribute. From-SVN: r182959
2011-12-22re PR debug/51650 (LTO ICE in dwarf2out_finish, at dwarf2out.c:22501 while ↵Richard Guenther1-0/+3
building libxul) 2011-12-22 Richard Guenther <rguenther@suse.de> PR lto/51650 * lto.c (uniquify_nodes): Register TYPE_DECLs with the debuginfo machinery. * g++.dg/lto/pr51650-1_0.C: New testcase. * g++.dg/lto/pr51650-2_0.C: Likewise. From-SVN: r182625
2011-12-21lto.c (GIMPLE_REGISTER_TYPE): New define.Richard Guenther2-4/+25
2011-12-21 Richard Guenther <rguenther@suse.de> lto/ * lto.c (GIMPLE_REGISTER_TYPE): New define. (LTO_FIXUP_TREE): Use it. (uniquify_nodes): Mark new non-prevailing types and avoid calling gimple_register_type on others. (lto_read_decls): Add comment. From-SVN: r182591
2011-12-13lto-streamer-out.c (write_symbol): Use proper 64-bit host type.Eric Botcazou3-12/+21
* lto-streamer-out.c (write_symbol): Use proper 64-bit host type. * lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets. * lto-streamer-in.c (lto_read_body): Likewise. (lto_input_toplevel_asms): Likewise. * lto-section-in.c (lto_create_simple_input_block): Likewise. * ipa-inline-analysis.c (inline_read_section): Likewise. * ipa-prop.c (ipa_prop_read_section): Likewise. * df.h (DF_NOTE): Fix typo in comment. lto/ * lto.h (lto_parse_hex): Delete. * lto.c (lto_read_decls): Use 'int' for offsets. (lto_parse_hex): Make static and return proper 64-bit host type. (lto_resolution_read): Use proper 64-bit host type. From-SVN: r182310
2011-12-13re PR debug/48354 (internal compiler error: in splice_child_die, at ↵Richard Guenther2-0/+13
dwarf2out.c:8064) 2011-12-13 Richard Guenther <rguenther@suse.de> PR lto/48354 * tree.c (find_decls_types_r): Also walk DECL_ORIGINAL_TYPE. * tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers): Stream DECL_ORIGINAL_TYPE. * tree-streamer-out.c (write_ts_decl_non_common_tree_pointers): Likewise. lto/ * lto.c (lto_ft_decl_non_common): When we merged DECL_ORIGINAL_TYPE with the type of the TYPE_DECL clear DECL_ORIGINAL_TYPE. * g++.dg/lto/pr48354-1_0.C: New testcase. From-SVN: r182286
2011-12-01lto-lang.c (lto_attribute_table): Handle *tm regparm.Uros Bizjak2-0/+23
* lto-lang.c (lto_attribute_table): Handle *tm regparm. (ignore_attribute): New. From-SVN: r181882
2011-11-22opts.c (finish_options): Do not fail for -fgnu-tm.Aldy Hernandez2-0/+22
* opts.c (finish_options): Do not fail for -fgnu-tm. * gimple-streamer-out.c (output_gimple_stmt): Handle GIMPLE_TRANSACTION. * gimple-streamer-in.c (input_gimple_stmt): Same. * lto-cgraph.c (input_overwrite_node): Read tm_clone bit. (lto_output_node): Write tm_clone bit. lto/ * lto-lang.c (lto_attribute_table): Handle transaction_pure. (handle_transaction_pure_attribute): New. From-SVN: r181629
2011-11-03re PR lto/44965 (lto option code breaks file format with each added option)Richard Guenther3-56/+8
2011-11-03 Richard Guenther <rguenther@suse.de> PR lto/44965 * lto-opts.c: Re-implement. * lto-streamer.h (lto_register_user_option): Remove. (lto_read_file_options): Likewise. (lto_reissue_options): Likewise. (lto_clear_user_options): Likewise. (lto_clear_file_options): Likewise. * opts-global.c (post_handling_callback): Remove. (set_default_handlers): Do not set post_handling_callback. (decode_options): Remove LTO specific code. * lto-wrapper.c (merge_and_complain): New function. (run_gcc): Read all input file options and prepend a merged set before the linker driver options. * gcc.c (driver_post_handling_callback): Remove. (set_option_handlers): Do not set post_handling_callback. * opts-common.c (handle_option): Do not call post_handling_callback. * opts.h (struct cl_option_handlers): Remove post_handling_callback. lto/ * lto-lang.c (lto_post_options): Do not read file options. * lto.c (lto_read_all_file_options): Remove. (lto_init): Call lto_set_in_hooks here. From-SVN: r180827
2011-10-21cgraph.c (dump_cgraph_node): Dump alias flag.Jan Hubicka1-0/+2
* cgraph.c (dump_cgraph_node): Dump alias flag. * cgraphunit.c (handle_alias_pairs): Handle weakrefs with no destination. (get_alias_symbol): New function. (output_weakrefs): Output also weakrefs with no destinatoin. (lto_output_node): Output weakref alias flag when at function boundary. From-SVN: r180292
2011-10-20lto.c (node_cmp, [...]): New functions.Jan Hubicka2-8/+110
* lto.c (node_cmp, varpool_node_cmp): New functions. (lto_balanced_map): Honnor -fno-toplevel-reorder of vars&functions. (cmp_partitions): Rename to ... (cmp_partitions_size): ... this one. (cmp_partitions_order): New function. (lto_wpa_write_files): Sort partitions by order when -fno-toplevel-reorder is used. From-SVN: r180248
2011-10-16Add error checking to lto_section_readAndi Kleen2-2/+13
gcc/lto/: 2011-10-09 Andi Kleen <ak@linux.intel.com> * lto.c (lto_section_read): Call fatal_error on IO or mmap errors. From-SVN: r180065
2011-10-11Convert standard builtin functions from being arrays to using a functional ↵Michael Meissner2-3/+9
interface From-SVN: r179820
2011-10-04Maintain order of LTO sectionsAndi Kleen4-36/+78
Currently when reading in LTO sections from ld -r files they can get randomly reordered based on hash tables and random IDs. This causes reordering later when the final code is generated and also makes crashes harder to reproduce. This patch maintains explicit lists based on the input order and uses those lists to preserve that order when starting the rest of the LTO passes. This is the first step to working -fno-toplevel-reorder for LTO. But this needs more changes because the LTO partitioner can still reorder. This add two lists: one for the section and another one for the file_decl_datas. This is needed because the sections are walked twice through different data structures. In addition some code becomes slightly cleaner because we don't need to pass state through abstract callbacks anymore, but can just use direct type safe calls. gcc/lto/: 2011-10-02 Andi Kleen <ak@linux.intel.com> * lto-object.c (lto_obj_add_section_data): Add list. (lto_obj_add_section): Fill in list. (ltoobj_build_section_table): Pass through list. * lto.c (file_data_list): Declare. (create_subid_section_table): Pass arguments directly. Fill in list of file_datas. (lwstate): Delete. (lto_create_files_from_ids): Pass in direct arguments. Don't maintain list. (lto_file_read): Use explicit section and file data lists. (lto_read_all_file_options): Pass in section_list. * lto.h (lto_obj_build_section_table): Add list. (lto_section_slot): Add next. (lto_section_list): Declare. From-SVN: r179505
2011-10-02re PR lto/47247 (Linker plugin specification makes it difficult to handle ↵Jan Hubicka3-4/+12
COMDATs) PR lto/47247 * lto-plugin.c (get_symbols_v2): New variable. (write_resolution): Use V2 API when available. (onload): Handle LDPT_GET_SYMBOLS_V2. * lto-symtab.c (lto_symtab_resolve_symbols): Do not resolve when resolution is already availbale from plugin. (lto_symtab_merge_decls_1): Handle LDPR_PREVAILING_DEF_IRONLY_EXP. * cgraph.c (ld_plugin_symbol_resolution): Add prevailing_def_ironly_exp. * lto-cgraph.c (LDPR_NUM_KNOWN): Update. * ipa.c (varpool_externally_visible_p): IRONLY variables are never externally visible. * varasm.c (resolution_to_local_definition_p): Add LDPR_PREVAILING_DEF_IRONLY_EXP. (resolution_local_p): Likewise. * common.c (lto_resolution_str): Add new resolution. * common.h (lto_resolution_str): Likewise. From-SVN: r179424
2011-09-30Use 64bit integer for LTO symbol ID.H.J. Lu2-8/+92
gcc/lto 2011-09-30 H.J. Lu <hongjiu.lu@intel.com> Andi Kleen <ak@linux.intel.com> PR lto/50568 * lto.c (lto_splay_tree_delete_id): New. (lto_splay_tree_compare_ids): Likewise. (lto_splay_tree_lookup): Likewise. (lto_splay_tree_id_equal_p): Likewise. (lto_splay_tree_insert): Likewise. (lto_splay_tree_new): Likewise. (lto_resolution_read): Change id to unsigned HOST_WIDE_INT. Use lto_splay_tree_id_equal_p and lto_splay_tree_lookup. (create_subid_section_table): Use lto_splay_tree_lookup and lto_splay_tree_insert. (lto_file_read): Use lto_splay_tree_new. lto-plugin/ 2011-09-30 H.J. Lu <hongjiu.lu@intel.com> Andi Kleen <ak@linux.intel.com> PR lto/50568 * lto-plugin.c (sym_aux): Change id to unsigned long long. (plugin_symtab): Likewise. (dump_symtab): Likewise. (resolve_conflicts): Likewise. (process_symtab): Likewise. Co-Authored-By: Andi Kleen <ak@linux.intel.com> From-SVN: r179395
2011-09-29Change random seeds to 64bit and drop re-crcingAndi Kleen2-7/+10
I had some trouble with random build failures in a large LTO project and it turned out to be random seed collisions in a highly parallel build (thanks to Honza for suggesting that) There were multiple problems: - The way to generate the random seed is not very random (milliseconds time plus pid) and prone to collisions on highly parallel builds - It's only 32bit - Several users take the existing ascii seed and re-CRC32 it again, which doesn't exactly improve it. This patch changes that to: - Always use 64bit seeds as numbers (no re-crcing) - Change all users to use HOST_WIDE_INT - When the user specifies a random seed it's still crc32ed, but only in this case. Passes bootstrap + testsuite on x86_64-linux. gcc/cp: 2011-09-26 Andi Kleen <ak@linux.intel.com> * repo.c (finish_repo): Use HOST_WIDE_INT_PRINT_HEX_PURE. gcc/: 2011-09-26 Andi Kleen <ak@linux.intel.com> * hwint.h (HOST_WIDE_INT_PRINT_HEX_PURE): Add. * lto-streamer.c (lto_get_section_name): Remove crc32_string. Handle numerical random seed. * lto-streamer.h (lto_file_decl_data): Change id to unsigned HOST_WIDE_INT. * toplev.c (random_seed): Add. (init_random_seed): Change for numerical random seed. (get_random_seed): Return as HOST_WIDE_INT. (set_random_seed): Crc32 existing string. * toplev.h (get_random_seed): Change to numercal return. * tree.c (get_file_function_name): Remove CRC. Handle numerical random seed. gcc/lto/: 2011-09-26 Andi Kleen <ak@linux.intel.com> * lto.c (lto_resolution_read): Remove id dumping. (lto_section_with_id): Turn id HOST_WIDE_ID. (create_subid_section_table): Dito. From-SVN: r179347
2011-08-28Fix the use of linemap_add and remove unnecessary kludgeDodji Seketeli2-2/+6
libcpp/ * line-map.c (linemap_add): Assert that reason must not be LC_RENAME when called for the first time on a "main input file". c-family/ * c-pch.c (c_common_read_pch): Call linemap_add with LC_ENTER as it's the first time it's being called on this main TU. gcc/lto/ * lto-lang.c (lto_init): Likewise. Also, avoid calling linemap_add twice. gcc/fortran/ * scanner.c (load_file): Don't abuse LC_RENAME reason while (indirectly) calling linemap_add. From-SVN: r178146
2011-08-12data-streamer.h (streamer_write_zero): Rename from output_zero.Diego Novillo1-8/+8
* data-streamer.h (streamer_write_zero): Rename from output_zero. (streamer_write_uhwi): Rename from lto_output_uleb128. (streamer_write_hwi): Rename from output_sleb128. (streamer_write_string): Rename from lto_output_string. (streamer_string_index): Rename from lto_string_index. (streamer_write_string_with_length): Rename from lto_output_string_with_length. (streamer_write_uhwi_stream): Rename from lto_output_uleb128_stream. (streamer_write_hwi_stream): Rename from lto_output_sleb128_stream. (streamer_read_string): Rename from lto_input_string. (streamer_read_indexed_string): Rename from input_string_internal. (streamer_read_uhwi): Rename from lto_input_uleb128. (streamer_read_hwi): Rename from lto_input_sleb128. (streamer_write_hwi_in_range): Rename from lto_output_int_in_range. (streamer_read_hwi_in_range): Rename from lto_input_int_in_range. (streamer_write_enum): Rename from lto_output_enum. (streamer_read_enum): Rename from lto_input_enum. (streamer_write_record_start): Rename from output_record_start. (streamer_read_record_start): Rename from input_record_start. (streamer_write_bitpack): Rename from lto_output_bitpack. (streamer_read_bitpack): Rename from lto_input_bitpack. (streamer_write_char_stream): Rename from lto_output_1_stream. (streamer_read_uchar): Rename from lto_input_1_unsigned. * tree-streamer.h (streamer_cache_d): Rename from lto_streamer_cache_d. (streamer_handle_as_builtin_p): Rename from lto_stream_as_builtin_p. (streamer_read_string_cst): Rename from input_string_cst. (streamer_read_chain): Rename from lto_input_chain. (streamer_alloc_tree): Rename from lto_materialize_tree. (streamer_read_tree_body): Rename from lto_input_tree_pointers. (streamer_get_pickled_tree): Rename from lto_get_pickled_tree. (streamer_get_builtin_tree): Rename from lto_get_builtin_tree. (streamer_read_integer_cst): Rename from lto_input_integer_cst. (streamer_read_tree_bitfields): Rename from tree_read_bitfields. (streamer_write_chain): Rename from lto_output_chain. (streamer_write_tree_header): Rename from lto_output_tree_header. (streamer_pack_tree_bitfields): Rename from pack_value_fields. (streamer_write_tree_body): Rename from lto_output_tree_pointers. (streamer_write_integer_cst): Rename from lto_output_integer_cst. (streamer_write_builtin): Rename from lto_output_builtin_tree. (streamer_check_handled_ts_structures): Rename from check_handled_ts_structures. (streamer_tree_cache_insert): Rename from lto_streamer_cache_insert. (streamer_tree_cache_insert_at): Rename from lto_streamer_cache_insert_at. (streamer_tree_cache_append): Rename from lto_streamer_cache_append. (streamer_tree_cache_lookup): Rename from lto_streamer_cache_lookup. (streamer_tree_cache_get): Rename from lto_streamer_cache_get. (streamer_tree_cache_create): Rename from lto_streamer_cache_create. (streamer_tree_cache_delete): Rename from lto_streamer_cache_delete. * tree-streamer-out.c (write_string_cst): Rename from output_string_cst. (write_identifier): Rename from output_identifier. (write_ts_common_tree_pointers): Rename from lto_output_ts_common_tree_pointers. (write_ts_vector_tree_pointers): Rename from lto_output_ts_vector_tree_pointers. (write_ts_complex_tree_pointers): Rename from lto_output_ts_complex_tree_pointers. (write_ts_decl_minimal_tree_pointers): Rename from lto_output_ts_decl_minimal_tree_pointers. (write_ts_decl_common_tree_pointers): Rename from lto_output_ts_decl_common_tree_pointers. (write_ts_decl_non_common_tree_pointers): Rename from lto_output_ts_decl_non_common_tree_pointers. (write_ts_decl_with_vis_tree_pointers): Rename from lto_output_ts_decl_with_vis_tree_pointers. (write_ts_field_decl_tree_pointers): Rename from lto_output_ts_field_decl_tree_pointers. (write_ts_function_decl_tree_pointers): Rename from lto_output_ts_function_decl_tree_pointers. (write_ts_type_common_tree_pointers): Rename from lto_output_ts_type_common_tree_pointers. (write_ts_type_non_common_tree_pointers): Rename from lto_output_ts_type_non_common_tree_pointers. (write_ts_list_tree_pointers): Rename from lto_output_ts_list_tree_pointers. (write_ts_vec_tree_pointers): Rename from lto_output_ts_vec_tree_pointers. (write_ts_exp_tree_pointers): Rename from lto_output_ts_exp_tree_pointers. (write_ts_block_tree_pointers): Rename from lto_output_ts_block_tree_pointers. (write_ts_binfo_tree_pointers): Rename from lto_output_ts_binfo_tree_pointers. (write_ts_constructor_tree_pointers): Rename from lto_output_ts_constructor_tree_pointers. (write_ts_target_option): Rename from lto_output_ts_target_option. (write_ts_translation_unit_decl_tree_pointers): Rename from lto_output_ts_translation_unit_decl_tree_pointers. * tree-streamer.c (streamer_tree_cache_add_to_node_array): Rename from lto_streamer_cache_add_to_node_array. (streamer_tree_cache_insert_1): Rename from lto_streamer_cache_insert_1. (record_common_node): Rename from lto_record_common_node. * streamer-hooks.h (bitpack_d, lto_streamer_cache_d): Remove forward declarations. * data-streamer-in.c (lto_input_widest_uint_uleb128): Remove unused function. * data-streamer-out.c (lto_output_widest_uint_uleb128_stream): Remove unused function. * Makefile.in (lto-section-out.o): Add dependency on DATA_STREAMER_H. (ipa-reference.o): Likewise. * lto-section-out.c: Include data-streamer.h. * ipa-reference.c: Include data-streamer.h. From-SVN: r177704
2011-08-11tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call ↵Diego Novillo2-1/+2
stream_write_tree instead of output_record_start. * tree-streamer-out.c (lto_output_ts_decl_with_vis_tree_pointers): Call stream_write_tree instead of output_record_start. (lto_output_ts_binfo_tree_pointers): Likewise. * streamer-hooks.h (stream_write_tree): Move from tree-streamer.h. Convert it to a macro. (stream_read_tree): Likewise. * lto-streamer.h (lto_stream_as_builtin_p): Move ... * tree-streamer.h (lto_stream_as_builtin_p): ... here. * lto-streamer-in.c (lto_read_tree): Call lto_streamer_cache_append and tree_read_bitfields. * lto-streamer-out.c (lto_is_streamable): Move from lto-streamer.c (lto_write_tree): Call it. * lto-streamer.c (lto_is_streamable): Move to lto-streamer-out.c * streamer-hooks.h (struct streamer_hooks): Remove fields name, is_streamable and alloc_tree. Update all users. * tree-streamer-in.c (tree_read_bitfields): Factor out of ... (lto_materialize_tree): ... here. Handle CALL_EXPR codes. Remove call to lto_streamer_cache_append. * tree-streamer-out.c (lto_output_tree_header): Handle CALL_EXPR nodes. * tree-streamer.h (tree_read_bitfields): Declare. * Makefile.in (TREE_STREAMER_H): Add STREAMER_HOOKS_H. (gimple-streamer-in.o): Add dependency on TREE_STREAMER_H. * tree-streamer.h (stream_read_tree): New. Replace all calls to lto_input_tree with it. (stream_write_tree): New. Replace all calls to lto_output_tree, lto_output_tree_ref and lto_output_tree_or_ref with it. * lto-streamer-in.c (lto_read_tree): Inline code from lto_streamer_read_tree. (lto_input_tree): Move from tree-streamer-in.c. * lto-streamer-out.c (lto_output_tree_ref): Make static. Remove handling of NULL values for EXPR. Do not handle EXPRs that are not indexable. (lto_write_tree): Move from tree-streamer-out.c. Inline lto_streamer_write_tree. (lto_output_tree): Move from tree-streamer-out.c. If REF_P is true and EXPR is indexable, call lto_output_tree_ref. * lto-streamer.c (lto_record_common_node): Move to tree-streamer.c. (lto_preload_common_nodes): Likewise. Remove assertions and adjustments for nodes main_identifier_node, ptrdiff_type_node and fileptr_type_node. (lto_streamer_hooks_init): Set streamer_hooks.write_tree to lto_output_tree and streamer_hooks.read_tree to lto_input_tree. * lto-streamer.h (lto_input_tree): Declare. (lto_output_tree_ref): Remove. * streamer-hooks.h (struct streamer_hooks): Remove fields preload_common_nodes, indexable_with_decls_p, pack_value_fields, unpack_value_fields, output_tree_header and has_unique_integer_csts_p. Update all users. * tree-streamer-in.c (lto_materialize_tree): Make extern. (lto_input_tree_pointers): Likewise. (lto_read_tree): Move to lto-streamer-in.c. (lto_input_integer_cst): Make extern. (lto_get_pickled_tree): Likewise. (lto_get_builtin_tree): Likewise. (lto_input_tree): Move to lto-streamer-in.c. * tree-streamer-out.c (pack_value_fields): Make extern. (lto_output_tree_or_ref): Remove. Replace all callers with calls to stream_write_tree. (lto_output_builtin_tree): Make extern. (lto_streamer_write_tree): Inline into lto_write_tree. (lto_output_tree_pointers): Make extern. (lto_output_tree_header): Likewise. (lto_output_integer_cst): Likewise. (lto_write_tree): Move to lto-streamer-out.c. (lto_output_tree): Likewise. * tree-streamer.c (lto_record_common_node): Move from lto-streamer.c (preload_common_nodes): Likewise. (lto_streamer_cache_create): Call it. * tree-streamer.h: Include streamer-hooks.h. (stream_write_tree): New. (stream_read_tree): New. (lto_input_tree): Remove. (lto_materialize_tree): Declare. (lto_input_tree_pointers): Declare. (lto_get_pickled_tree): Declare. (lto_get_builtin_tree): Declare. (lto_input_integer_cst): Declare. (lto_output_tree_header): Declare. (pack_value_fields): Declare. (lto_output_tree_pointers): Declare. (lto_output_integer_cst): Declare. (lto_output_builtin_tree): Declare. From-SVN: r177661
2011-08-11lto.c (uniquify_nodes): Use main variant's BINFO too.Martin Jambor2-0/+6
2011-08-11 Martin Jambor <mjambor@suse.cz> lto/ * lto.c (uniquify_nodes): Use main variant's BINFO too. From-SVN: r177650
2011-08-08rebaseDiego Novillo3-1/+7
From-SVN: r177571
2011-07-06tree.c (build_common_tree_nodes_2): Merge with build_common_tree_nodes.Richard Guenther2-3/+6
2011-07-06 Richard Guenther <rguenther@suse.de> * tree.c (build_common_tree_nodes_2): Merge with build_common_tree_nodes. * tree.h (build_common_tree_nodes): Adjust prototype. (build_common_tree_nodes_2): Remove. * doc/tm.texi.in (lang_hooks.builtin_function): Adjust. * doc/tm.texi (lang_hooks.builtin_function): Regenerate. c-family/ * c-common.c (c_common_nodes_and_builtins): Merge calls to build_common_tree_nodes and build_common_tree_nodes_2. fortran/ * f95-lang.c (gfc_init_decl_processing): Merge calls to build_common_tree_nodes and build_common_tree_nodes_2. go/ * go-lang.c (go_langhook_init): Merge calls to build_common_tree_nodes and build_common_tree_nodes_2. java/ * decl.c (java_init_decl_processing): Merge calls to build_common_tree_nodes and build_common_tree_nodes_2. lto/ * lto-lang.c (lto_init): Merge calls to build_common_tree_nodes and build_common_tree_nodes_2. ada/ * gcc-interface/misc.c (gnat_init): Merge calls to build_common_tree_nodes and build_common_tree_nodes_2. Re-initialize boolean_false_node. From-SVN: r175906
2011-06-18oops, comitted with wrong PR# :( PR lto/48246Jan Hubicka1-1/+1
oops, comitted with wrong PR# :( PR lto/48246 * lto.c (lto_1_to_1_map): Don't create empty partitions. (lto_balanced_map): Likewise. From-SVN: r175175
2011-06-18re PR lto/48246 (ICE in lto_wpa_write_files)Jan Hubicka2-8/+17
PR lto/23754 * lto.c (lto_1_to_1_map): Don't create empty partitions. (lto_balanced_map): Likewise. From-SVN: r175174
2011-06-11lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code.Jan Hubicka2-34/+51
* lto-symtab.c (lto_cgraph_replace_node): Kill same body alias code. (lto_symtab_resolve_can_prevail_p): Likewise. (lto_symtab_merge_cgraph_nodes): Update merging of aliases. * cgraph.c (same_body_aliases_done): New global var. (cgraph_same_body_alias_1): Rename to ... (cgraph_create_function_alias): ... this one; reorg to new representation. (cgraph_same_body_alias): Use cgraph_create_function_alias; record references when asked to. (cgraph_add_thunk): Fix formating. (cgraph_get_node): Kill same body alias code. (cgraph_node_for_asm): Likewise. (cgraph_remove_same_body_alias): Remove. (cgraph_remove_node): Kill same body alias code. (cgraph_mark_address_taken_node): Mark also the aliased function as having address taken. (dump_cgraph_node): Dump same body aliases. (cgraph_for_node_thunks_and_aliases): Update for new alias representation. (cgraph_for_node_and_aliases): Likewise. * cgraph.h (same_body): Kll pointer. (same_body_alias): Update comment. (same_body_aliases_done): Declare. (cgraph_remove_same_body_alias): Remove declaration. (cgraph_create_function_alias): Declare. (cgraph_process_same_body_aliases): Declare. (cgraph_function_with_gimple_body_p): Check for alias. (cgraph_can_remove_if_no_direct_calls_p): Look for aliases. (cgraph_alias_aliased_node): New function. (cgraph_function_node): Update for new aliases. (cgraph_function_or_thunk_node): Likewise. * ipa-inline-transform.c (can_remove_node_now_p): Look for aliases. (inline_call): Remove dead aliases. * cgraphunit.c (cgraph_decide_is_function_needed): Disable assembler name hack for same body aliases. (clone_of_p): Look through aliases. (verify_cgraph_node): Verify aliases. (cgraph_analyze_function): Analyze aliases; fixup C++ bugs. (cgraph_process_same_body_aliases): New function. (process_function_and_variable_attributes): Disable weakref warning on alias. (cgraph_analyze_functions): Handle aliases. (cgraph_mark_functions_to_output): Handle aliases same way as thunks. (assemble_thunks): Rename to ... (assemble_thunks_and_aliases): ... this one; handle aliases, too. (cgraph_expand_function): Remove alias output code. (cgraph_output_in_order): Skip aliases. (cgraph_preserve_function_body_p): Aliases don't need preserving. * ipa-ref.c (ipa_ref_use_name): Add alias reference. (ipa_record_reference): Do not assert on alias references. (ipa_ref_has_aliases_p): New function. * ipa-ref.h (enum ipa_ref_use): Add IPA_REF_ALIAS. (ipa_ref_has_aliases_p): Declare. * lto-cgraph.c (lto_output_node): Handle aliases. (input_node): Likewise. * lto-streamer-out.c (lto_output): Skip aliases. (produce_symtab): Kill same_body_alias code. * ipa-utils.c (ipa_reverse_postorder): Add FIXME. (ipa_reverse_postorder): Use cgraph_only_called_directly_or_aliased_p. * ipa-inline.c (update_caller_keys): Walk aliases. (inline_small_functions): Fix thinko in previous patch. * ipa.c (cgraph_externally_visible_p): Do not walk aliases. (function_and_variable_visibility): Do not walk same body aliases. * tree-ssa-structalias.c (associate_varinfo_to_alias): New function. (ipa_pta_execute): Use it. * lto.c (add_cgraph_node_to_partition_1): Break out from ... (add_cgraph_node_to_partition) ... here; walk aliases. (lto_1_to_1_map): Remove same body alias code. (promote_fn): Likewise. (lto_promote_cross_file_statics): Update comment. * decl2.c (cp_write_global_declarations): Process aliases; look trhough same body aliases. From-SVN: r174952
2011-06-07lto.c (uniquify_nodes): Move code to register decls to the loop that ↵Diego Novillo2-20/+21
computes canonical types. * lto.c (uniquify_nodes): Move code to register decls to the loop that computes canonical types. From-SVN: r174745
2011-06-07tree.c (build_common_tree_nodes): Also initialize size_type_node.Richard Guenther2-11/+5
2011-06-07 Richard Guenther <rguenther@suse.de> * tree.c (build_common_tree_nodes): Also initialize size_type_node. Call set_sizetype from here. c-family/ * c-common.c (c_common_nodes_and_builtins): Do not set size_type_node or call set_sizetype. go/ * go-lang.c (go_langhook_init): Do not set size_type_node or call set_sizetype. fortran/ * f95-lang.c (gfc_init_decl_processing): Do not set size_type_node or call set_sizetype. java/ * decl.c (java_init_decl_processing): Properly initialize size_type_node. lto/ * lto-lang.c (lto_init): Do not set size_type_node or call set_sizetype. ada/ * gcc-interface/misc.c (gnat_init): Do not set size_type_node or call set_sizetype. From-SVN: r174743
2011-06-06Makefile.in (lto-compress.o): Add dependency on LTO_STREAMER_H.Diego Novillo2-3/+22
* Makefile.in (lto-compress.o): Add dependency on LTO_STREAMER_H. (cgraph.o): Likewise. (cgraphunit.o): Likewise. * cgraphunit.c: Include lto-streamer.h (cgraph_finalize_compilation_unit): Call lto_streamer_hooks_init if LTO is enabled. * lto-streamer-in.c (unpack_value_fields): Call streamer_hooks.unpack_value_fields if set. (lto_materialize_tree): For unhandled nodes, first try to call lto_streamer_hooks.alloc_tree, if it exists. (lto_input_ts_decl_common_tree_pointers): Move reading of DECL_INITIAL to lto_streamer_read_tree. (lto_read_tree): Call lto_streamer_hooks.read_tree if set. (lto_streamer_read_tree): New. (lto_reader_init): Rename from lto_init_reader. Move initialization code to lto/lto.c. * lto-streamer-out.c (pack_value_fields): Call streamer_hooks.pack_value_fields if set. (lto_output_tree_ref): For tree nodes that are not normally indexable, call streamer_hooks.indexable_with_decls_p before giving up. (lto_output_ts_decl_common_tree_pointers): Move handling for FUNCTION_DECL and TRANSLATION_UNIT_DECL to lto_streamer_write_tree. (lto_output_tree_header): Call streamer_hooks.is_streamable instead of lto_is_streamable. Call lto_streamer_hooks.output_tree_header if set. (lto_write_tree): Call lto_streamer_hooks.write_tree if set. (lto_streamer_write_tree): New. (lto_output): Call lto_streamer_init directly. (lto_writer_init): Remove. * lto-streamer.c (streamer_hooks): New. (lto_streamer_cache_create): Call streamer_hooks.preload_common_nodes instead of lto_preload_common_nodes. (lto_is_streamable): Move from lto-streamer.h (lto_streamer_hooks_init): New. (streamer_hooks): New. (streamer_hooks_init): New. * lto-streamer.h (struct output_block): Forward declare. (struct lto_input_block): Likewise. (struct data_in): Likewise. (struct bitpack_d): Likewise. (struct streamer_hooks): Declare. (streamer_hooks): Declare. (lto_streamer_hooks_init): Declare. (lto_streamer_write_tree): Declare. (lto_streamer_read_tree): Declare. (streamer_hooks_init): Declare. (lto_is_streamable): Move to lto-streamer.c lto/ChangeLog * lto.c (lto_init): New. (lto_main): Call it. From-SVN: r174709
2011-06-03lto-streamer-in.c (get_resolution): Move to lto/lto.c.Diego Novillo2-5/+155
* lto-streamer-in.c (get_resolution): Move to lto/lto.c. (lto_register_var_decl_in_symtab): Likewise. (lto_register_function_decl_in_symtab): Likewise. (lto_read_tree): Move VAR_DECL and FUNCTION_DECL registration logic to lto_read_decls. lto/ChangeLog * lto.c (get_resolution): Move from lto-streamer-in.c. (lto_register_var_decl_in_symtab): Likewise. (lto_register_function_decl_in_symtab): Likewise. (uniquify_nodes): Call lto_register_var_decl and lto_register_function_decl_in_symtab after reading a new VAR_DECL or FUNCTION_DECL. From-SVN: r174604
2011-06-01tree.c (free_lang_data): Do not reset boolean_type_node nor char_type_node.Richard Guenther2-21/+40
2011-06-01 Richard Guenther <rguenther@suse.de> * tree.c (free_lang_data): Do not reset boolean_type_node nor char_type_node. * lto-streamer.c (lto_record_common_node): Take node pointer, do not register types. (lto_preload_common_nodes): Explicitly skip preloading nodes that differ between frontends. lto/ * lto-lang.c (lto_register_canonical_types): New function. (lto_init): Register common nodes with the canonical type machinery. Do not play tricks with char_type_node. From-SVN: r174519
2011-05-26lto.c (uniquify_nodes): Fix bug in one of the previous changes.Richard Guenther2-26/+33
2011-05-26 Richard Guenther <rguenther@suse.de> lto/ * lto.c (uniquify_nodes): Fix bug in one of the previous changes. From-SVN: r174296
2011-05-25move TS_EXP to be a substructure of TS_TYPEDNathan Froyd2-6/+22
move TS_EXP to be a substructure of TS_TYPED gcc/ * tree.h (struct tree_exp): Inherit from struct tree_typed. * tree.c (initialize_tree_contains_struct): Mark TS_EXP as TS_TYPED instead of TS_COMMON. gcc/lto/ * lto.c (lto_ft_typed): New function. (lto_ft_common): Call it. (lto_ft_constructor): Likewise. (lto_ft_expr): Likewise. (lto_fixup_prevailing_decls): Check for TS_COMMON before accessing TREE_CHAIN. From-SVN: r174192
2011-05-20gimple.c (gimple_register_type_1): Do not fiddle with main-variant or ↵Richard Guenther2-136/+122
pointer-to chains. 2011-05-20 Richard Guenther <rguenther@suse.de> * gimple.c (gimple_register_type_1): Do not fiddle with main-variant or pointer-to chains. Delay all fixup to uniquify_nodes. lto/ * lto.c (lto_ft_common): Remove pointer-to chain teardown. (lto_ft_type): Move main-variant and pointer-to chain building ... (uniquify_nodes): ... here. Compute TYPE_CANONICAL also here, in a separate final loop. From-SVN: r173938
2011-05-19gimple.c (gimple_types_compatible_p_1): Compare names of the types themselves.Richard Guenther2-0/+19
2011-05-19 Richard Guenther <rguenther@suse.de> * gimple.c (gimple_types_compatible_p_1): Compare names of the types themselves. (iterative_hash_gimple_type): And hash them that way. (gimple_register_type_1): If we register a main variant properly initialize the leader to ourselves. lto/ * lto.c (uniquify_nodes): First register all types before fixing up the tree SCC. From-SVN: r173900
2011-05-12re PR lto/48952 (ICE in inline_merge_summary during linux kernel LTO build)Jan Hubicka2-1/+5
PR lto/48952 * lto.c (do_whole_program_analysis): Do not register cgraph hooks. From-SVN: r173700
2011-05-11split tree_typeNathan Froyd2-6/+12
split tree_type gcc/ada/ * gcc-interface/ada-tree.h (TYPE_OBJECT_RECORD_TYPE): Use TYPE_MINVAL. (TYPE_GCC_MIN_VALUE): Use TYPE_MINVAL. (TYPE_GCC_MAX_VALUE): Use TYPE_MAXVAL. gcc/cp/ * cp-tree.h (TYPENAME_TYPE_FULLNAME, TYPEOF_TYPE_EXPR): Use TYPE_VALUES_RAW. (UNDERLYING_TYPE_TYPE, DECLTYPE_TYPE_EXPR): Likewise. (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P): Likewise. (TEMPLATE_TYPE_PARM_INDEX): Likewise. gcc/ * ggc-page.c (extra_order_size_table): Use struct tree_type_non_common. * lto-streamer-in.c (unpack_ts_type_value_fields): Rename to... (unpack_ts_type_common_value_fields): ...this. Update comment. (unpack_value_fields): Adjust for renaming. (lto_input_ts_type_tree_pointers): Split into... (lto_input_ts_type_common_tree_pointer): ...this and... (lto_input_ts_type_non_common_tree_pointers): ...this. (lto_input_tree_pointers): Adjust for above split. * lto-streamer-out.c (pack_ts_type_value_fields): Rename to... (pack_ts_type_common_value_fields): ...this. Update comment. (lto_output_ts_type_tree_pointers): Split into... (lto_output_ts_type_common_tree_pointers): ...this and... (lto_output_ts_type_non_common_tree_pointers): ...this. (lto_output_tree_pointers): Adjust for above split. * lto-streamer.c (check_handled_ts_structures): Mark TS_TYPE_COMMON, TS_TYPE_WITH_LANG_SPECIFIC, and TS_TYPE_NON_COMMON as handled. * stor-layout.c (vector_type_mode): Adjust location of mode field. * tree.h (MARK_TS_TYPE_COMMON, MARK_TS_TYPE_WITH_LANG_SPECIFIC): Define. (struct tree_type): Split into... (struct tree_type_common: ...this and... (struct tree_type_with_lang_specific): ...this and... (struct tree_type_non_common): ...this. Adjust accessor macros accordingly. (TYPE_VALUES_RAW): Define. (union tree_node): Update for above changes. * tree.c (tree_node_structure_for_code) [tcc_type]: Return TS_TYPE_NON_COMMON. (initialize_tree_contains_struct) [TS_TYPE]: Use TS_TYPE_COMMON. Add TS_TYPE_WITH_LANG_SPECIFIC and TS_TYPE_NON_COMMON. (tree_code_size) [tcc_type]: Use struct tree_type_non_common. * treestructu.def (TS_TYPE): Remove. (TS_TYPE_COMMON, TS_TYPE_WITH_LANG_SPECIFIC, TS_TYPE_NON_COMMON): Define. gcc/java/ * java-tree.h (TYPE_ARGUMENT_SIGNATURE): Use TYPE_MINVAL. gcc/lto/ * lto.c (lto_ft_type): Use TYPE_MINVAL and TYPE_MAXVAL. Adjust location of binfo field. (lto_fixup_prevailing_decls): Likewise. gcc/objc/ * objc-act.h (CLASS_NAME, CLASS_SUPER_NAME): Use proper accessors. (CLASS_NST_METHODS, CLASS_CLS_METHODS): Likewise. (PROTOCOL_NAME, PROTOCOL_NST_METHODS, PROTOCOL_CLS_METHODS): Likewise. From-SVN: r173658
2011-05-10use build_function_type less in c-family and LTONathan Froyd2-7/+13
use build_function_type less in c-family and LTO gcc/c-family/ * c-common.c (def_fn_type): Don't call build_function_type, call build_function_type_array or build_varargs_function_type_array instead. (c_common_nodes_and_builtins): Likewise. gcc/lto/ * lto-lang.c (def_fn_type): Don't call build_function_type, call build_function_type_array or build_varargs_function_type_array instead. From-SVN: r173623
2011-05-08Fix long linesEric Botcazou1-2/+4
From-SVN: r173546
2011-05-07langhooks.h (lang_hooks_for_types): Change global_bindings_p's return type ↵Eric Botcazou2-2/+8
to bool and adjust comment. 2011-05-07  Eric Botcazou  <ebotcazou@adacore.com> * langhooks.h (lang_hooks_for_types): Change global_bindings_p's return type to bool and adjust comment. * fold-const.c (fold_range_test): Adjust call to global_bindings_p. (fold_mathfn_compare): Remove calls to global_bindings_p. (fold_inf_compare): Likewise. * stor-layout.c (variable_size): Adjust call to global_bindings_p. * c-tree.h (global_bindings_p): Adjust prototype. * c-decl.c (global_bindings_p): Return bool and simplify. ada/ * gcc-interface/gigi.h (global_bindings_p): Adjust prototype. * gcc-interface/utils.c (global_bindings_p): Return bool and simplify. cp/ * name-lookup.h (global_bindings_p): Adjust prototype. * name-lookup.c (global_bindings_p): Return bool. fortran/ * f95-lang.c (global_bindings_p): Return bool and simplify. go/ * go-lang.c (global_bindings_p): Return bool and simplify. java/ * java-tree.h (global_bindings_p): Adjust prototype. * decl.c (global_bindings_p): Return bool. lto/ * lto-lang.c (global_bindings_p): Return bool. From-SVN: r173535
2011-05-06cgraph.c (cgraph_add_thunk): Create real function node instead of alias node...Jan Hubicka2-2/+28
* cgraph.c (cgraph_add_thunk): Create real function node instead of alias node; finalize it and mark needed/reachale; arrange visibility to be right and add it into the corresponding same comdat group list. (dump_cgraph_node): Dump thunks. * cgraph.h (cgraph_first_defined_function, cgraph_next_defined_function, cgraph_function_with_gimple_body_p, cgraph_first_function_with_gimple_body, cgraph_next_function_with_gimple_body): New functions. (FOR_EACH_FUNCTION_WITH_GIMPLE_BODY, FOR_EACH_DEFINED_FUNCTION): New macros. * ipa-cp.c (ipcp_need_redirect_p): Thunks can't be redirected. (ipcp_generate_summary): Use FOR_EACH_FUNCTION_WITH_GIMPLE_BODY. * cgraphunit.c (cgraph_finalize_function): Only look into possible devirtualization when optimizing. (verify_cgraph_node): Verify thunks. (cgraph_analyze_function): Analyze thunks. (cgraph_mark_functions_to_output): Output thunks only in combination with function they are assigned to. (assemble_thunk): Turn thunk into non-thunk; don't try to turn alias into normal node. (assemble_thunks): New functoin. (cgraph_expand_function): Use it. * lto-cgraph.c (lto_output_node): Stream thunks. (input_overwrite_node): Stream in thunks. * ipa-pure-const.c (analyze_function): Thunks do nothing interesting. * lto-streamer-out.c (lto_output): Do not try to output thunk's body. * ipa-inline.c (inline_small_functions): Use FOR_EACH_DEFINED_FUNCTION. * ipa-inline-analysis.c (compute_inline_parameters): "Analyze" thunks. (inline_analyze_function): Do not care about thunk jump functions. (inline_generate_summary):Use FOR_EACH_DEFINED_FUNCTION. * ipa-prop.c (ipa_prop_write_jump_functions): Use cgraph_function_with_gimple_body_p. * passes.c (do_per_function_toporder): Use cgraph_function_with_gimple_body_p. (execute_one_pass);Use FOR_EACH_FUNCTION_WITH_GIMPLE_BODY. (ipa_write_summaries): Use cgraph_function_with_gimple_body_p. (function_called_by_processed_nodes_p): Likewise. * lto.c (lto_materialize_function): Use cgraph_function_with_gimple_body_p. (add_cgraph_node_to_partition): Do not re-add items to partition; handle thunks. (add_varpool_node_to_partition): Do not re-add items to partition. From-SVN: r173517
2011-05-03* lto.c (free_ltrans_partitions): Fix accidental commit.Jan Hubicka2-3/+7
From-SVN: r173336
2011-05-03cgraph.h (cgraph_node_set_def, [...]): Move out of GTY; replace hash by ↵Jan Hubicka2-6/+30
pointer map. * cgraph.h (cgraph_node_set_def, varpool_node_set_def): Move out of GTY; replace hash by pointer map. (cgraph_node_set_element_def, cgraph_node_set_element, const_cgraph_node_set_element, varpool_node_set_element_def, varpool_node_set_element, const_varpool_node_set_element): Remove. (free_cgraph_node_set, free_varpool_node_set): New function. (cgraph_node_set_size, varpool_node_set_size): Use vector size. * tree-emutls.c: Free varpool node set. * ipa-utils.c (cgraph_node_set_new, cgraph_node_set_add, cgraph_node_set_remove, cgraph_node_set_find, dump_cgraph_node_set, debug_cgraph_node_set, free_cgraph_node_set, varpool_node_set_new, varpool_node_set_add, varpool_node_set_remove, varpool_node_set_find, dump_varpool_node_set, free_varpool_node_set, debug_varpool_node_set): Move here from ipa.c; implement using pointer_map * ipa.c (cgraph_node_set_new, cgraph_node_set_add, cgraph_node_set_remove, cgraph_node_set_find, dump_cgraph_node_set, debug_cgraph_node_set, varpool_node_set_new, varpool_node_set_add, varpool_node_set_remove, varpool_node_set_find, dump_varpool_node_set, debug_varpool_node_set): Move to ipa-uitls.c. * lto/lto.c (ltrans_partition_def): Remove GTY annotations. (ltrans_partitions): Move to heap. (new_partition): Update. (free_ltrans_partitions): New function. (lto_wpa_write_files): Use it. * passes.c (ipa_write_summaries): Update. From-SVN: r173334
2011-04-30cgraph.h (cgraph_postorder): Remove declaration.Martin Jambor3-2/+9
2011-04-29 Martin Jambor <mjambor@suse.cz> * cgraph.h (cgraph_postorder): Remove declaration. * ipa-utils.h (ipa_free_postorder_info): Declare. (ipa_reverse_postorder): Likewise. * cgraphunit.c: Include ipa-utils.h. (cgraph_expand_all_functions): Update call to ipa_reverse_postorder. * ipa-inline.c: Include ipa-utils.h. (ipa_inline): Update call to ipa_reverse_postorder. * ipa-pure-const.c (propagate_pure_const): Update call to ipa_reduced_postorder and ipa_print_order. Call ipa_free_postorder_info to clean up. (propagate_nothrow): Likewise. * ipa-reference.c (propagate): Removed a useless call to ipa_utils_reduced_inorder, updated a call to ipa_reduced_postorder and ipa_print_order. Call ipa_free_postorder_info to clean up. * ipa.c: Include ipa-utils.h. (ipa_profile): Update call to ipa_reverse_postorder. (cgraph_postorder): Moved to... * ipa-utils.c (ipa_reverse_postorder): ...here and renamed. (ipa_utils_print_order): Renamed to ipa_print_order. (ipa_utils_reduced_inorder): Renamed to ipa_reduced_postorder. Updated comments. (ipa_free_postorder_info): New function. * passes.c: Include ipa-utils.h. (do_per_function_toporder): Update call to ipa_reverse_postorder. (ipa_write_summaries): Likewise. * Makefile.in (passes.o): Add IPA_UTILS_H to dependencies. (cgraphunit.o): Likewise. (ipa.o): Likewise. (ipa-inline.o): Likewise. lto/ * lto.c: Include ipa-utils.h. (lto_balanced_map): Update call to ipa_reverse_postorder. * Make-lang.in (lto/lto.o): Add IPA_UTILS_H to dependencies. From-SVN: r173197
2011-04-29lto-streamer.c (lto_streamer_cache_insert_1): Accept to override other trees ↵Michael Matz3-414/+564
that just builtins. * lto-streamer.c (lto_streamer_cache_insert_1): Accept to override other trees that just builtins. (lto_record_common_node): Don't leave NULL TYPE_CANONICAL. lto/ * lto.c (toplevel): Include tree-flow.h. (lto_read_in_decl_state): Don't merge types here. (tree_with_vars): New static hash table. (remember_with_vars): New static functions. (LTO_FIXUP_TYPE): New macro. (lto_ft_common, lto_ft_decl_minimal, lto_ft_decl_common, lto_ft_decl_with_vis, lto_ft_decl_non_common, lto_ft_function, lto_ft_field_decl, lto_ft_type, lto_ft_binfo, lto_ft_constructor, lto_ft_expr, lto_fixup_types, uniquify_nodes): New static functions. (lto_read_decls): Uniquify while reading in trees. (lto_fixup_data_t, LTO_FIXUP_SUBTREE, LTO_REGISTER_TYPE_AND_FIXUP_SUBTREE, no_fixup_p, lto_fixup_common, lto_fixup_decl_minimal, lto_fixup_decl_common, lto_fixup_decl_with_vis, lto_fixup_decl_non_common, lto_fixup_function, lto_fixup_field_decl, lto_fixup_type, lto_fixup_binfo, lto_fixup_constructor, lto_fixup_tree): Remove. (lto_fixup_state): Remove data argument. Use lto_symtab_prevailing_decl. (LTO_SET_PREVAIL, LTO_NO_PREVAIL): New macros. (lto_fixup_prevailing_decls): New function. (lto_fixup_state_aux): Argument aux is unused. (lto_fixup_decls): Don't allocate pointer sets, don't use lto_fixup_tree, use lto_fixup_prevailing_decls. (read_cgraph_and_symbols): Allocate and remove tree_with_vars. * Make-lang.in (lto/lto.o): Depend on $(TREE_FLOW_H). From-SVN: r173155
2011-04-16lto.c (lto_balanced_map): Fix typos in head comment.Eric Botcazou2-56/+70
* lto.c (lto_balanced_map): Fix typos in head comment. (lto_promote_cross_file_statics): Fix long lines and remove redundant test. From-SVN: r172584
2011-04-16cgraphbuild.c: Include ipa-inline.h.Jan Hubicka2-2/+6
* cgraphbuild.c: Include ipa-inline.h. (reset_inline_failed): Use initialize_inline_failed. * cgraph.c: Include ipa-inline.h. (cgraph_create_node_1): Do not initialize estimated_growth. (initialize_inline_failed): More to ipa-inline-analysis.c (dump_cgraph_node): Do not dump inline flags. * cgraph.h (cgraph_local_info): Remove inlineable, versionable and disregard_inline_limits flags. (cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset, time, size, estimated_growth. * ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update. * cgraphunit.c (cgraph_decide_is_function_needed): Use DECL_DISREGARD_INLINE_LIMITS. (cgraph_analyze_function): Do not initialize node->local.disregard_inline_limits. * lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream inlinable, versionable and disregard_inline_limits. * ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness, update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update. (cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE for uninlinable functions. (cgraph_decide_inlining, cgraph_edge_early_inlinable_p, cgraph_decide_inlining_incrementally): Update. * ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits, estimated_stack_size, stack_frame_offset, time, size and estimated_growth parameters. (estimate_edge_growth): Update. (initialize_inline_failed): Declare. * ipa-split.c: Include ipa-inline.h (execute_split_functions): Update. * ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS. (cgraph_remove_unreachable_nodes): Do not clear inlinable flag. (record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS. * ipa-inline-analysis.c (inline_node_removal_hook): Update; set estimated_growth to INT_MIN. (inline_node_duplication_hook): Likewise. (dump_inline_summary): Dump new fields. (compute_inline_parameters): Update. (estimate_edge_time, estimate_time_after_inlining, estimate_size_after_inlining, estimate_growth, inline_read_summary, inline_write_summary): (initialize_inline_failed): Move here from cgraph.c. * tree-sra.c: Include ipa-inline.h. (ipa_sra_preliminary_function_checks): Update. * lto/lto.c (lto_balanced_map): Update. Update. * Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on ipa-inline.h From-SVN: r172581
2011-04-14cgraph.c (dump_cgraph_node): Do not dump inline summaries.Jan Hubicka3-3/+12
* cgraph.c (dump_cgraph_node): Do not dump inline summaries. * cgraph.h (struct inline_summary): Move to ipa-inline.h (cgraph_local_info): Remove inline_summary. * ipa-cp.c: Include ipa-inline.h. (ipcp_cloning_candidate_p, ipcp_estimate_growth, ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline_summary accesor. * lto-cgraph.c (lto_output_node): Do not stream inline summary. (input_overwrite_node): Do not set inline summary. (input_node): Do not stream inline summary. * ipa-inline.c (cgraph_decide_inlining): Dump inline summaries. (cgraph_decide_inlining_incrementally): Do not try to estimate overall growth; we do not have inline parameters computed for that anyway. (cgraph_early_inlining): After inlining compute call_stmt_sizes. * ipa-inline.h (struct inline_summary): Move here from ipa-inline.h (inline_summary_t): New type and VECtor. (debug_inline_summary, dump_inline_summaries): Declare. (inline_summary): Use VOCtor. (estimate_edge_growth): Kill hack computing call stmt size directly. * lto-section-in.c (lto_section_name): Add inline section. * ipa-inline-analysis.c: Include lto-streamer.h (node_removal_hook_holder, node_duplication_hook_holder): New holders (inline_node_removal_hook, inline_node_duplication_hook): New functions. (inline_summary_vec): Define. (inline_summary_alloc, dump_inline_summary, debug_inline_summary, dump_inline_summaries): New functions. (estimate_function_body_sizes): Properly compute size/time of outgoing calls. (compute_inline_parameters): Alloc inline_summary; do not compute size/time of incomming calls. (estimate_edge_time): Avoid missing time summary hack. (inline_read_summary): Read inline summary info. (inline_write_summary): Write inline summary info. (inline_free_summary): Free all hooks and inline summary vector. * lto-streamer.h: Add LTO_section_inline_summary section. * Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update dependencies. * ipa.c (cgraph_remove_unreachable_nodes): Fix dump file formating. * lto.c: Include ipa-inline.h (add_cgraph_node_to_partition, undo_partition): Use inline_summary accessor. (ipa_node_duplication_hook): Fix declaration. * Make-lang.in (lto.o): Update dependencies. From-SVN: r172430
2011-04-13ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling ↵Nathan Froyd3-2/+9
TREE_CHAIN. gcc/ada/ * gcc-interface/ada-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * gcc-interface/misc.c (gnat_init_ts): New function. (LANG_HOOKS_INIT_TS): Define. gcc/ * c-decl.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * print-tree.c (print_node): Likewise. * tree-inline.c (copy_tree_r): Likewise. * c-lang.c (LANG_HOOKS_INIT_TS): Define. * lto-streamer-in.c (lto_input_tree_pointers): Check for TS_TYPED instead of TS_COMMON. * lto-streamer-out.c (lto_output_tree_pointers): Likewise. * tree.c (initialize_tree_contains_struct): Handle TS_TYPED. (copy_node_stat): Zero TREE_CHAIN only if necessary. (MARK_TS_BASE, MARK_TS_TYPED, MARK_TS_COMMON): Move these... (MARK_TS_DECL_COMMON, MARK_TS_DECL_COMMON, MARK_TS_DECL_WRTL): ...and these... (MARK_TS_DECL_WITH_VIS, MARK_TS_DECL_NON_COMMON): ...and these... * tree.h: ...here. (TREE_CHAIN): Check for a TS_COMMON structure. (TREE_TYPE): Check for a TS_TYPED structure. gcc/c-family/ * c-common.h (c_common_init_ts): Declare. * c-common.c (c_common_init_ts): Define. gcc/cp/ * cp-lang.c (cp_init_ts): Call cp_common_init_ts. Move tree_contains_struct initialization to... * cp-objcp-common.c (cp_common_init_ts): ...here. Use MARK_* macros. * cp-objcp-common.h (cp_common_init_ts): Declare. * cp-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/fortran/ * f95-lang.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/go/ * go-lang.c (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/java/ * java-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. gcc/lto/ * lto-tree.h (union lang_tree_node): Check for TS_COMMON before calling TREE_CHAIN. * lto.c (lto_fixup_common): Likewise. gcc/objc/ * objc-lang.c (objc_init_ts): Move code for this function... * objc-act.c (objc_common_init_ts): ...here. Define. * objc-act.h (objc_common_init_ts): Declare. gcc/objcp/ * objcp-lang.c (objcxx_init_ts): Call objc_common_init_ts and cp_common_init_ts. From-SVN: r172359
2011-04-10Remove doubled up words.Mike Stump1-3/+4
From-SVN: r172247
2011-04-08utils.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPESNathan Froyd2-14/+7
gcc/ada/ * gcc-interface/utils.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES (handle_type_generic_attribute): Likewise. gcc/c-family/ * c-common.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES. (handle_type_generic_attribute): Likewise. gcc/lto/ * lto-lang.c (handle_sentinel_attribute): Don't use TYPE_ARG_TYPES. (handle_type_generic_attribute): Likewise. From-SVN: r172200