aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-utils.h
AgeCommit message (Collapse)AuthorFilesLines
2020-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r279813
2019-12-10Check for TYPE_DECL in get_odr_name_for_typeRichard Sandiford1-0/+1
Make get_odr_name_for_type check for TYPE_DECL in the way that its caller warn_types_mismatch previously did. 2019-12-10 Richard Sandiford <richard.sandiford@arm.com> gcc/ * ipa-utils.h (get_odr_name_for_type): Check for a TYPE_DECL. * ipa-devirt.c (warn_types_mismatch): Don't call xstrdup for the second demangled name. gcc/testsuite/ * gcc.dg/lto/tag-1_0.c, gcc.dg/lto/tag-1_1.c: New test. From-SVN: r279159
2019-12-02Refactor IPA devirt a bit.Martin Liska1-0/+14
2019-12-02 Martin Liska <mliska@suse.cz> * ipa-devirt.c (warn_types_mismatch): Use get_odr_name_for_type function. (debug_tree_odr_name): New. * ipa-utils.h (get_odr_name_for_type): New. 2019-12-02 Martin Liska <mliska@suse.cz> * g++.dg/lto/odr-7_0.C: New test. * g++.dg/lto/odr-7_1.C: New test. From-SVN: r278898
2019-11-15ipa: Remove stray declarationMartin Jambor1-3/+0
2019-11-15 Martin Jambor <mjambor@suse.cz> * ipa-utils.h (ipa_remove_useless_jump_functions): Remove stray declaration. From-SVN: r278303
2019-11-04ipa-inline-transform.c: Include ipa-utils.hJan Hubicka1-0/+4
* ipa-inline-transform.c: Include ipa-utils.h (inline_call): Set thunk_expansion flag. * ipa-utils.h (thunk_expansion): Declare. * ipa-devirt.c (thunk_expansion): New global var. (devirt_node_removal_hook): Do not invalidate cache while doing thunk expansion. From-SVN: r277789
2019-06-27class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base type copy.Jan Hubicka1-0/+3
* class.c (layout_class_type): Set TYPE_CXX_ODR_P for as-base type copy. * ipa-devirt.c (odr_type_d): Add tbaa_enabled flag. (add_type_duplicate): When odr hash is not allocated, to nothing. (odr_based_tbaa_p): New function. (set_type_canonical_for_odr_type): New function. * ipa-utils.h (enable_odr_based_tbaa, odr_based_tbaa_p, set_type_canonical_for_odr_type): New. * tree.c (gimple_canonical_types_compatible_p): ODR types with ODR based TBAA are not equivalent to non-ODR types. * lto-common.c: Include demangle.h and tree-pretty-print.h (type_streaming_finished): New static var. (gimple_register_canonical_type_1): Return updated hash; handle ODR types. (iterative_hash_canonical_type): Update use of gimple_register_canonical_type_1. * g++.dg/lto/alias-2_0.C: New testcase. * g++.dg/lto/alias-2_1.C: New testcase. From-SVN: r272749
2019-06-24ipa-utils.h (type_with_linkage_p): Verify that type is CXX_ODR_P.Jan Hubicka1-0/+2
* ipa-utils.h (type_with_linkage_p): Verify that type is CXX_ODR_P. (odr_type_p): Remove extra return. * lto-streamer-out.c (hash_tree): Hash TYPE_CXX_ODR_P; hash STRING_FLAG only for arrays and integers. * tree-stremaer-in.c (unpack_ts_type_common_value_fields): Update analogously. * tree-streamer-out.c (pack_ts_type_common_value_fields): Likewise. * print-tree.c (print_node): Print cxx-odr-p and string-flag. * tree.c (need_assembler_name_p): Also check that type is CXX_ODR_TYPE_P (verify_type_variant): Update verification of SRING_FLAG; also check CXX_ODR_P. * tree.h (ARRAY_OR_INTEGER_TYPE_CHECK): New macro. (TYPE_STRING_FLAG): Use it. (TYPE_CXX_ODR_P): New macro. * lto-common.c (compare_tree_sccs_1): Compare CXX_ODR_P; compare STRING_FLAG only for arrays and integers. * gcc-interface/decl.c (gnat_to_gnu_entity): Check that type is array or integer prior checking string flag. * gcc-interface/gigi.h (gnat_signed_type_for, maybe_character_value): Likewise. * c-common.c (braced_lists_to_strings): Check that type is array or integer prior checking string flag. * lex.c (cxx_make_type): Set TYPE_CXX_ODR_P. * dwarf2out.c (gen_array_type_die): First check that type is an array and then test string flag. * trans-expr.c (gfc_conv_substring): Check that type is array or integer prior checking string flag. (gfc_conv_string_parameter): Likewise. * trans-openmp.c (gfc_omp_scalar_p): Likewise. * trans.c (gfc_build_array_ref): Likewise. From-SVN: r272628
2019-06-17Remove dead code (PR ipa/90874).Martin Liska1-1/+0
2019-06-17 Martin Liska <mliska@suse.cz> PR ipa/90874 * ipa-utils.h (odr_type_p): Remove dead code. From-SVN: r272378
2019-06-10Reduce SCCs in IPA postorder.Martin Liska1-2/+0
2019-06-10 Martin Liska <mliska@suse.cz> * ipa-cp.c (ignore_edge_p): New function. (build_toporder_info): Use it. * ipa-inline.c (ignore_edge_p): New function/ (inline_small_functions): Use it. * ipa-pure-const.c (ignore_edge_for_nothrow): Verify opt_for_fn for caller and callee. (ignore_edge_for_pure_const): Likewise. * ipa-reference.c (ignore_edge_p): Extend to check for opt_for_fn. * ipa-utils.c (searchc): Refactor. * ipa-utils.h: Fix coding style. From-SVN: r272115
2019-06-07common.opt (flto-odr-type-merging): Ignore.Jan Hubicka1-24/+4
* common.opt (flto-odr-type-merging): Ignore. * invoke.texi (-flto-odr-type-merging): Remove. * ipa-devirt.c (odr_vtable_hasher:odr_name_hasher): Remove. (can_be_vtable_hashed_p): Remove. (hash_odr_vtable): Remove. (odr_vtable_hasher::hash): Remove. (types_same_for_odr): Remove. (types_odr_comparable): Remove. (odr_vtable_hasher::equal): Remove. (odr_vtable_hash_type, odr_vtable_hash): Remove. (add_type_duplicate): Do not synchronize vtable and name hashtables. (get_odr_type): Do not use vtable hash. (dump_odr_type): Remove commented out code. (build_type_inheritance_graph): Do not allocate vtable hash. (rebuild_type_inheritance_graph): Do not delete vtable hash. * ipa-utils.h (type_with_linkage_p): Drop vtable hash path. (odr_type_p): Likewise. * tree.c (need_assembler_name_p): Remove flag_lto_odr_type_mering test. From-SVN: r272037
2019-06-01alias.c: Include ipa-utils.h.Jan Hubicka1-0/+1
* alias.c: Include ipa-utils.h. (get_alias_set): Try to complete ODR type via ODR type hash lookup. * ipa-devirt.c (prevailing_odr_type): New. * ipa-utils.h (previaling_odr_type): Declare. * g++.dg/lto/alias-1_0.C: New testcase. * g++.dg/lto/alias-1_1.C: New testcase. From-SVN: r271837
2019-02-11Construct ipa_reduced_postorder always for overwritable (PR ipa/89009).Martin Liska1-1/+1
2019-02-11 Martin Liska <mliska@suse.cz> PR ipa/89009 * ipa-cp.c (build_toporder_info): Remove usage of a param. * ipa-inline.c (inline_small_functions): Likewise. * ipa-pure-const.c (propagate_pure_const): Likewise. (propagate_nothrow): Likewise. * ipa-reference.c (propagate): Likewise. * ipa-utils.c (struct searchc_env): Remove unused field. (searchc): Always search across AVAIL_INTERPOSABLE. (ipa_reduced_postorder): Always allow AVAIL_INTERPOSABLE as the only called IPA pure const can properly not propagate across interposable boundary. * ipa-utils.h (ipa_reduced_postorder): Remove param. 2019-02-11 Martin Liska <mliska@suse.cz> PR ipa/89009 * g++.dg/ipa/pr89009.C: New test. From-SVN: r268762
2019-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r267494
2018-12-24ipa-devirt.c (dump_targets): Cap number of targets printed.Jan Hubicka1-3/+5
* ipa-devirt.c (dump_targets): Cap number of targets printed. (dump_possible_polymorphic_call_targets): Add verbose parameter. (ipa_devirt): Use it. * ipa-utils.h (dump_possible_polymorphic_call_targets): Add verbose parametrs. From-SVN: r267400
2018-12-24lto-symtab.c (lto_symtab_merge_decls_2): Do not report ODR violations for ↵Jan Hubicka1-0/+1
method whose basetype was already reported. * lto-symtab.c (lto_symtab_merge_decls_2): Do not report ODR violations for method whose basetype was already reported. * ipa-devirt.c (odr_type_violation_reported_p): New. * ipa-utils.h (odr_type_violation_reported_p): Declare. From-SVN: r267397
2018-10-26ipa-devirt.c (warn_odr): Make static.Jan Hubicka1-1/+2
* ipa-devirt.c (warn_odr): Make static. (types_same_for_odr): Drop strict variant. (types_odr_comparable): Likewise. (odr_or_derived_type_p): Look for main variants. (odr_name_hasher::equal): Cleanup comment. (odr_subtypes_equivalent): Add warn and warned arguments; check main variants. (type_variants_equivalent_p): break out from ... (odr_types_equivalent): ... here; go for main variants where needed. (warn_odr): ... here; turn static. (warn_types_mismatch): Compare mangled names of main variants. * ipa-utils.h (types_odr_comparable): Drop strict parameter. (type_with_linkage_p): Sanity check that we look at main variant. * lto.c (lto_read_decls): Only consider main variant to be ODR type. * tree.h (types_same_for_odr): Drop strict argument. From-SVN: r265519
2018-10-24ipa-utils.h (type_with_linkage_p): No longer check for TYPE_STUB_DECL; it is ↵Jan Hubicka1-3/+3
wrong for forward declarations. * ipa-utils.h (type_with_linkage_p): No longer check for TYPE_STUB_DECL; it is wrong for forward declarations. From-SVN: r265460
2018-08-30lto-streamer-out.c (DFS::DFS_write_tree_body): Do not follow TYPE_STUB_DECL.Jan Hubicka1-27/+27
* lto-streamer-out.c (DFS::DFS_write_tree_body): Do not follow TYPE_STUB_DECL. (hash_tree): Do not visit TYPE_STUB_DECL. * tree-streamer-out.c (write_ts_type_common_tree_pointers): Do not stream TYPE_STUB_DECL. * tree-streamer-in.c (lto_input_ts_type_common_tree_pointers): Likewise. * ipa-utils.h (type_with_linkage_p): Do not rely on TYPE_STUB_DECL after free_lang_data. (type_in_anonymous_namespace_p): Likewise. From-SVN: r263985
2018-04-10re PR lto/85078 (LTO ICE: tree check: expected tree that contains 'decl ↵Jan Hubicka1-0/+1
minimal' structure, have 'identifier_node' in decl_mangling_context, at cp/mangle.c:878) PR lto/85078 * ipa-devirt.c (rebuild_type_inheritance-hash): New. * ipa-utils.h (rebuild_type_inheritance-hash): Declare. * tree.c (free_lang_data_in_type): Fix handling of binfos; walk basetypes. (free_lang_data): Rebuild type inheritance graph. * g++.dg/torture/pr85078.C: New. From-SVN: r259264
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-10-11[PATCH] DECL_ASSEMBLER_NAME and friendsNathan Sidwell1-9/+8
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00582.html * tree.h (DECL_ASSEMBLER_NAME_SET_P): Don't check HAS_DECL_ASSEMBLER_NAME_P. * gimple-expr.c (gimple_decl_printable_name: Check HAS_DECL_ASSEMBLER_NAME_P too. * ipa-utils.h (type_in_anonymous_namespace_p): Check DECL_ASSEMBLER_NAME_SET_P of TYPE_NAME. (odr_type_p): No need to assert TYPE_NAME is a TYPE_DECL. * passes.c (rest_of_decl_compilation): Check HAS_DECL_ASSEMBLER_NAME_P too. * recog.c (verify_changes): Likewise. * tree-pretty-print.c (dump_decl_name): Likewise. * tree-ssa-structalias.c (alias_get_name): Likewise. Reimplement. c/ * c-decl.c (grokdeclarator): Check HAS_DECL_ASSEMBLER_NAME_P too. From-SVN: r253649
2017-07-14Remove Java references in source code.Martin Liska1-3/+0
2017-07-14 Martin Liska <mliska@suse.cz> * cfgexpand.c (expand_gimple_basic_block): Remove dead comment. * dwarf2out.c (is_java): Remove the function. (output_pubname): Remove usage of the function. (lower_bound_default): Remove usage of DW_LANG_Java. (gen_compile_unit_die): Likewise. * gcc.c: Remove compiler defaults for .java and .zip files. * gimple-expr.c (remove_suffix): Change as there's no longer extension than 4-letter one. * gimplify.c (mostly_copy_tree_r): Remove Java-special part. (gimplify_save_expr): Likewise. * ipa-utils.h (polymorphic_type_binfo_p): Remove the comment as it's possible even for other languages than Java. * langhooks.h (struct lang_hooks): Remove Java from a comment. * lto-opts.c (lto_write_options): Remove reference to Java. * opts.c (strip_off_ending): Update file extension handling. * tree-cfg.c (verify_gimple_call): Remove comment with Java. * tree-eh.c (lower_resx): Likewise. * tree.c (free_lang_data_in_type): Remove dead code. (find_decls_types_r): Likewise. (build_common_builtin_nodes): Remove Java from a comment. (verify_type): Remove dead code. * varasm.c (assemble_external): Remove Java from a comment. From-SVN: r250199
2017-01-01Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r243994
2016-04-14re PR c++/70594 (-fcompare-debug failure)Jakub Jelinek1-0/+1
PR c++/70594 * ipa-utils.h (polymorphic_ctor_dtor_p): New prototype. * ipa-polymorphic-call.c (polymorphic_ctor_dtor_p): New function. (inlined_polymorphic_ctor_dtor_block_p): Use it. * tree-ssa-live.c (remove_unused_scope_block_p): When in_ctor_dtor_block, avoid discarding not just BLOCKs with BLOCK_ABSTRACT_ORIGIN being FUNCTION_DECL, but even when block_ultimate_origin is FUNCTION_DECL. (remove_unused_locals): If current_function_decl is polymorphic_ctor_dtor_p, pass initial true to remove_unused_scope_block_p' is_ctor_dtor_block. From-SVN: r234987
2016-01-04Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r232055
2015-12-01ipa-devirt.c (type_with_linkage_p, [...]): Move to ...Jan Hubicka1-2/+86
* ipa-devirt.c (type_with_linkage_p, type_in_anonymous_namespace_p, odr_type_p): Move to ... * ipa-utils.h (type_with_linkage_p, type_in_anonymous_namespace_p, odr_type_p): here; miscro-optimize. From-SVN: r231098
2015-09-20switch from gimple to gimple*Trevor Saunders1-3/+3
This renames the gimple_statement_base struct to gimple removes the typedef of gimple_statement_base * to gimple, and then adjusts all of the places that use the type. gcc/ChangeLog: 2015-09-19 Trevor Saunders <tbsaunde@tbsaunde.org> * coretypes.h (gimple): Change typedef to be a forward declaration. * gimple.h (gimple_statement_base): rename to gimple. * (all functions and types using gimple): Adjust. * *.[ch]: Likewise. gcc/cp/ChangeLog: 2015-09-19 Trevor Saunders <tbsaunde@tbsaunde.org> * cp-gimplify.c (gimplify_must_not_throw_expr): Adjust. From-SVN: r227941
2015-06-08re PR lto/65378 (Tweak to wording of -Wodr message)Jan Hubicka1-1/+2
PR lto/65378 * ipa-utils.h (warn_types_mismatch): Update prototype. * ipa-devirt.c (odr_types_equivalent_p): Add loc1/loc2 parameters. (type_mismatch_p): New function. (warn_types_mismatch): Reorg to work better on non-C++ types. (odr_types_equivalent_p): Add loc1/loc2 parameters. (add_type_duplicate): Update. * lto-symtab.c (warn_type_compatibility_p): Fix call of odr_or_derived_type_p. (lto_symtab_merge_decls_2): Update call of warn_types_mismatch. From-SVN: r224248
2015-05-24ipa-utils.h (method_class_type): Remove.Jan Hubicka1-1/+0
* ipa-utils.h (method_class_type): Remove. * cgraphunit.c (walk_polymorphic_call_targets): Use TYPE_METHOD_BASETYPE. * ipa-devirt.c (type_in_anonymous_namespace_p): Check that it is called on main variants only. (method_class_type): Remove. (update_type_inheritance_graph): Use TYPE_METHOD_BASETYPE. (build_type_inheritance_graph): Likewise. * ipa-icf.c (sem_function::equals_wpa): Likewise. * pa-polymorphic-call.c (decl_maybe_in_construction_p, check_stmt_for_type_change): Use TYPE_METHOD_BASETYPE. From-SVN: r223629
2015-05-19ipa-devirt.c (type_in_anonymous_namespace_p): Return true or implicit ↵Jan Hubicka1-1/+1
declarations. * ipa-devirt.c (type_in_anonymous_namespace_p): Return true or implicit declarations. (odr_type_p): Check that TYPE_NAME is TYPE_DECL before looking into it. (get_odr_type): Check type has linkage before adding bases. (register_odr_type): Check that type has linkage before adding it. (type_known_to_have_no_deriavations_p): Rename to .. (type_known_to_have_no_derivations_p): This one. * ipa-utils.h (type_known_to_have_no_deriavations_p): Rename to .. (type_known_to_have_no_derivations_p): This one. * ipa-polymorphic-call.c (ipa_polymorphic_call_context::restrict_to_inner_type): Check that type has linkage. From-SVN: r223415
2015-05-16ipa-utils.h (warn_types_mismatch, [...]): Declare.Jan Hubicka1-1/+6
* ipa-utils.h (warn_types_mismatch, odr_or_derived_type_p, odr_types_equivalent_p): Declare. (odr_type_p): Use gcc_checking_assert. (type_in_anonymous_namespace_p) Declare. (type_with_linkage_p): Declare. * common.opt (Wlto-type-mismatch): New warning. * ipa-devirt.c (compound_type_base): New function. (odr_or_derived_type_p): New function. (odr_types_equivalent_p): New function. (add_type_duplicate): Simplify. (type_with_linkage_p): Add hack to prevent false positives on C types (type_in_anonymous_namespace_p): Likewise. * tree.c (need_assembler_name_p): Use type_with_linkage. * tree.h (type_in_anonymous_namespace_p): Remove. * doc/invoke.texi (-Wlto-type-mismatch): Document * lto-symtab.c (warn_type_compatibility_p): Break out from ...; compare ODR types (if available) and function types. (lto_symtab_merge): ... here; output ODR violation warnings and call warn_types_mismatch. * gfortran.dg/lto/20091028-2_1.c: Fix return value. * gfortran.dg/lto/pr41576_1.f90: Add interface. * gfortran.dg/lto/pr41521_0.f90: Disable lto-type-mismatch * gfortran.dg/lto/pr60635_0.f90: Disable lto-type-mismatch. * gfortran.dg/lto/20091028-1_1.c: Fix return type. * gcc.dg/lto/20120723_0.c: Disbale lto-type-mismatch. From-SVN: r223258
2015-05-12ipa-devirt.c (type_with_linkage_p): New function.Jan Hubicka1-17/+1
* ipa-devirt.c (type_with_linkage_p): New function. (type_in_anonymous_namespace_p): Move here from tree.c; assert that type has linkage. (odr_type_p): Move here from ipa-utils.h; use type_with_linkage_p. (can_be_name_hashed_p): Simplify. (hash_odr_name): Check that type has linkage before checking if it is anonymous. (types_same_for_odr): Likewise. (odr_name_hasher::equal): Likewise. (odr_subtypes_equivalent_p): Likewise. (warn_types_mismatch): Likewise. (get_odr_type): Likewise. (odr_types_equivalent_p): Fix checking of TYPE_MAIN_VARIANT. * ipa-utils.h (odr_type_p): Move offline. * tree.c (need_assembler_name_p): Fix handling of types without linkages. (type_in_anonymous_namespace_p): Move to ipa-devirt.c From-SVN: r223094
2015-03-30re PR ipa/65610 (Compare debug failure with -g3 -fsanitize=undefined ↵Jakub Jelinek1-0/+1
-fno-sanitize=vptr -O3) PR ipa/65610 * ipa-utils.h (inlined_polymorphic_ctor_dtor_block_p): Declare. * ipa-polymorphic-call.c (inlined_polymorphic_ctor_dtor_block_p): New function. (decl_maybe_in_construction_p, noncall_stmt_may_be_vtbl_ptr_store): Use it. * ipa-prop.c (param_type_may_change_p): Likewise. * tree-ssa-live.c: Include ipa-utils.h and its dependencies. (remove_unused_scope_block_p): Add in_ctor_dtor_block argument. Before inlining, preserve inlined_polymorphic_ctor_dtor_block_p blocks and the outermost block with FUNCTION_DECL BLOCK_ABSTRACT_ORIGIN inside of them. Adjust recursive calls. (remove_unused_locals): Adjust remove_unused_scope_block_p caller. * g++.dg/ubsan/pr65610.C: New test. From-SVN: r221781
2015-03-09re PR lto/65316 (LTO: Uninitialized memory / ICE with -g ↵Jan Hubicka1-1/+1
-fno-lto-odr-type-merging: in types_same_for_odr, at ipa-devirt.c:465) PR lto/65316 * ipa-utils.h (types_odr_comparable): Add strict argument. * ipa-devirt.c: Fix whitespace; (odr_hasher): Remove. (odr_name_hasher, odr_vtable_hasher): New hashers. (can_be_name_hashed_p): New predicate. (hash_type_name): remove. (hash_odr_name): New. (odr_name_hasher::hash): new. (can_be_vtable_hashed_p): New. (hash_odr_vtable): New. (odr_vtable_hasher::hash): New. (types_same_for_odr): Add strict parameter. (types_odr_comparable): Likewise. (odr_name_hasher::equal): New. (odr_vtable_hasher::equal): New. (odr_name_hasher::remove): New. (odr_hash_type): Change to hash_table<odr_name_hasher>. (odr_vtable_hash_type): New. (odr_vtable_hash): New. (odr_subtypes_equivalent_p): Do strict comparsion. (add_type_duplicate): Merge type names; cleanup; avoid type duplicates. (register_odr_type): Initialize vtable hash. (build_type_inheritance_graph): Likewise (get_odr_type): Reorg to use two hashes. (dump_possible_polymorphic_call_targets): Move sanity check after debug output. (ipa_devirt): Dump type_inheritance_graph. (types_same_for_odr): Add strict mode. * g++.dg/lto/pr65316_0.C: New testcase. * g++.dg/lto/pr65316_1.C: New testcase. From-SVN: r221275
2015-02-01re PR ipa/64872 (ICE: Segmentation fault during Chromium PGO build)Jan Hubicka1-1/+1
PR ipa/64872 * ipa-utils.c (ipa_merge_profiles): Add release argument. * ipa-icf.c (sem_function::merge): Do not release body when merging. * ipa-utils.h (ipa_merge_profiles): Update prototype. From-SVN: r220329
2015-01-05Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r219188
2014-11-20tree.c (free_lang_data_in_type): If BINFO has no important information in ↵Jan Hubicka1-1/+2
it, set it to NULL. * tree.c (free_lang_data_in_type): If BINFO has no important information in it, set it to NULL. (get_binfo_at_offset): Do not walk fields, only bases. * ipa-utils.h (polymorphic_type_binfo_p): Be ready for BINFO_TYPE to be NULL. * ipa-polymorphic-call.c (record_known_type): Likewise. From-SVN: r217824
2014-11-13ipa-utils.h: Fix typo in comments.Felix Yang1-1/+1
* ipa-utils.h: Fix typo in comments. * ipa-profile.c: Likewise. * tree-ssa-loop-ivcanon.c: Fix typo in comments and debugging dump. From-SVN: r217507
2014-10-28cgraph.h: Flatten.Andrew MacLeod1-1/+0
* cgraph.h: Flatten. Remove all include files. (symbol_table::initialize): Move to cgraph.c. * cgraph.c: Adjust include files. (symbol_table::initialize): Relocate from cgraph.h. * gengtype.c (open_base_files): Adjust include files. * gccplugin.h: Add hash-map.h, is-a.h, plugin-api.h, and ipa-ref.h to included files. * ipa-inline.h: Remove all include files. * ipa-prop.h: Ditto. * ipa-reference.h: Ditto. * ipa-utils.h: Ditto: * lto-streamer.h: Remove cgraph.h from include list. * asan.c: Adjust include files. * auto-profile.c: Ditto. * bb-reorder.c: Ditto. * calls.c: Ditto. * cfgexpand.c: Ditto. * cgraphbuild.c: Ditto. * cgraphclones.c: Ditto. * cgraphunit.c: Ditto. * combine.c: Ditto. * coverage.c: Ditto. * data-streamer.c: Ditto. * data-streamer-in.c: Ditto. * data-streamer-out.c: Ditto. * dbxout.c: Ditto. * dwarf2out.c: Ditto. * except.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fold-const.c: Ditto. * ggc-page.c: Ditto. * gimple-fold.c: Ditto. * gimple-iterator.c: Ditto. * gimple-pretty-print.c: Ditto. * gimple-streamer-in.c: Ditto. * gimple-streamer-out.c: Ditto. * gimplify.c: Ditto. * ipa.c: Ditto. * ipa-comdats.c: Ditto. * ipa-cp.c: Ditto. * ipa-devirt.c: Ditto. * ipa-icf.c: Ditto. * ipa-icf-gimple.c: Ditto. * ipa-inline-analysis.c: Ditto. * ipa-inline.c: Ditto. * ipa-inline-transform.c: Ditto. * ipa-polymorphic-call.c: Ditto. * ipa-profile.c: Ditto. * ipa-prop.c: Ditto. * ipa-pure-const.c: Ditto. * ipa-ref.c: Ditto. * ipa-reference.c: Ditto. * ipa-split.c: Ditto. * ipa-utils.c: Ditto. * ipa-visibility.c: Ditto. * langhooks.c: Ditto. * lto-cgraph.c: Ditto. * lto-compress.c: Ditto. * lto-opts.c: Ditto. * lto-section-in.c: Ditto. * lto-section-out.c: Ditto. * lto-streamer.c: Ditto. * lto-streamer-in.c: Ditto. * lto-streamer-out.c: Ditto. * omp-low.c: Ditto. * opts-global.c: Ditto. * passes.c: Ditto. * predict.c: Ditto. * print-tree.c: Ditto. * profile.c: Ditto. * ree.c: Ditto. * stor-layout.c: Ditto. * symtab.c: Ditto. * toplev.c: Ditto. * trans-mem.c: Ditto. * tree.c: Ditto. * tree-cfg.c: Ditto. * tree-eh.c: Ditto. * tree-emutls.c: Ditto. * tree-inline.c: Ditto. * tree-nested.c: Ditto. * tree-pretty-print.c: Ditto. * tree-profile.c: Ditto. * tree-sra.c: Ditto. * tree-ssa-alias.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * tree-ssa-pre.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-streamer.c: Ditto. * tree-streamer-in.c: Ditto. * tree-streamer-out.c: Ditto. * tree-switch-conversion.c: Ditto. * tree-tailcall.c: Ditto. * tree-vect-data-refs.c: Ditto. * tree-vectorizer.c: Ditto. * tree-vect-stmts.c: Ditto. * tsan.c: Ditto. * ubsan.c: Ditto. * value-prof.c: Ditto. * varasm.c: Ditto. * varpool.c: Ditto. * config/arm/arm.c: Ditto. * config/bfin/bfin.c: Ditto. * config/c6x/c6x.c: Ditto. * config/cris/cris.c: Ditto. * config/darwin.c: Ditto. * config/darwin-c.c: Ditto. * config/i386/i386.c: Ditto. * config/i386/winnt.c: Ditto. * config/microblaze/microblaze.c: Ditto. * config/mips/mips.c: Ditto. * config/rs6000/rs6000.c: Ditto. * config/rx/rx.c: Ditto. * ada/gcc-interface/trans.c: Adjust include files. * ada/gcc-interface/utils.c: Ditto. * c/c-decl.c: Adjust include files. * c/c-parser.c: Ditto. * c-family/c-common.c: Adjust include files. * c-family/c-gimplify.c: Ditto. * c-family/cilk.c: Ditto. * c-family/c-pragma.c: Ditto. * c-family/c-ubsan.c: Ditto. * cp/call.c: Adjust include files. * cp/class.c: Ditto. * cp/decl2.c: Ditto. * cp/decl.c: Ditto. * cp/lambda.c: Ditto. * cp/mangle.c: Ditto. * cp/method.c: Ditto. * cp/optimize.c: Ditto. * cp/parser.c: Ditto. * cp/semantics.c: Ditto. * cp/tree.c: Ditto. * cp/vtable-class-hierarchy.c: Ditto. * fortran/f95-lang.c: Adjust include files. * fortran/trans-decl.c: Ditto. * go/go-gcc.cc: Adjust include files. * java/class.c: Adjust include files. * java/decl.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * lto/lto.c: Adjust include files. * lto/lto-lang.c: Ditto. * lto/lto-object.c: Ditto. * lto/lto-partition.c: Ditto. * lto/lto-symtab.c: Ditto. * objc/objc-act.c: Adjust include files. From-SVN: r216805
2014-10-02ipa-prop.h (ipa_get_controlled_uses): Add hack to avoid ICE when speculation ↵Jan Hubicka1-0/+2
is added. * ipa-prop.h (ipa_get_controlled_uses): Add hack to avoid ICE when speculation is added. (ipa_edge_args): Add polymorphic_call_contexts. (ipa_get_ith_polymorhic_call_context): New accesor. (ipa_make_edge_direct_to_target): Add SPECULATIVE parameter. * ipa-prop.c (ipa_print_node_jump_functions_for_edge): Print contexts. (ipa_compute_jump_functions_for_edge): Compute contexts. (update_jump_functions_after_inlining): Update contexts. (ipa_make_edge_direct_to_target): Add SPECULATIVE argument; update dumping; add speculative edge creation. (try_make_edge_direct_virtual_call): Add CTX_PTR parameter; handle context updating. (update_indirect_edges_after_inlining): Pass down context. (ipa_edge_duplication_hook): Duplicate contexts. (ipa_write_node_info): Stream out contexts. (ipa_read_node_info): Stream in contexts. * ipa-devirt.c (type_all_derivations_known_p): Avoid ICE on non-ODR types. (try_speculative_devirtualization): New function. * ipa-utils.h (try_speculative_devirtualization): Declare. From-SVN: r215794
2014-09-26cgraph.c (cgraph_node::release_body): New argument keep_arguments introduced.Martin Liska1-2/+4
* cgraph.c (cgraph_node::release_body): New argument keep_arguments introduced. * cgraph.h: Likewise. * cgraphunit.c (cgraph_node::create_wrapper): Usage of new argument introduced. * ipa-utils.h (polymorphic_type_binfo_p): Safe check for binfos created by Java. * tree-ssa-alias.c (ao_ref_base_alias_set): Static function transformed to global. * tree-ssa-alias.h: Likewise. From-SVN: r215640
2014-09-25ipa-utils.h (subbinfo_with_vtable_at_offset, [...]): Declare.Jan Hubicka1-0/+20
* ipa-utils.h (subbinfo_with_vtable_at_offset, type_all_derivations_known_p, type_known_to_have_no_deriavations_p, types_must_be_same_for_odr, types_odr_comparable): Declare. (polymorphic_type_binfo_p): Move here from ipa-devirt.c * ipa-polymorphic-call.c: New file. (contains_polymorphic_type_p, possible_placement_new, ipa_polymorphic_call_context::restrict_to_inner_class, contains_type_p, decl_maybe_in_construction_p, ipa_polymorphic_call_context::stream_out, ipa_polymorphic_call_context::debug, ipa_polymorphic_call_context::stream_in, ipa_polymorphic_call_context::set_by_decl, ipa_polymorphic_call_context::set_by_invariant, walk_ssa_copies, ipa_polymorphic_call_context::ipa_polymorphic_call_context, type_change_info, noncall_stmt_may_be_vtbl_ptr_store, extr_type_from_vtbl_ptr_store, record_known_type check_stmt_for_type_change, ipa_polymorphic_call_context::get_dynamic_type): Move here from ipa-devirt.c * ipa-devirt.c: No longer include data-streamer.h, lto-streamer.h and streamer-hooks.h (contains_polymorphic_type_p, possible_placement_new, ipa_polymorphic_call_context::restrict_to_inner_class, contains_type_p, decl_maybe_in_construction_p, ipa_polymorphic_call_context::stream_out, ipa_polymorphic_call_context::debug, ipa_polymorphic_call_context::stream_in, ipa_polymorphic_call_context::set_by_decl, ipa_polymorphic_call_context::set_by_invariant, walk_ssa_copies, ipa_polymorphic_call_context::ipa_polymorphic_call_context, type_change_info, noncall_stmt_may_be_vtbl_ptr_store, extr_type_from_vtbl_ptr_store, record_known_type check_stmt_for_type_change, ipa_polymorphic_call_context::get_dynamic_type): Move to ipa-polymorphic-call.c (type_all_derivations_known_p, types_odr_comparable, types_must_be_same_for_odr): Export. (type_known_to_have_no_deriavations_p): New function. * Makefile.in: Add ipa-polymorphic-call.c From-SVN: r215615
2014-09-25ipa-devirt.c (polymorphic_call_target_d): Add SPECULATIVE; reorder for ↵Jan Hubicka1-3/+3
better storage. * ipa-devirt.c (polymorphic_call_target_d): Add SPECULATIVE; reorder for better storage. (polymorphic_call_target_hasher::hash): Hash SPECULATIVE. (possible_polymorphic_call_targets): Instead of computing both speculative and non-speculative answers, do just one at a time. Replace NONSPECULATIVE_TARGETSP parameter with SPECULATIVE flag. (dump_targets): Break out from ... (dump_possible_polymorphic_call_targets): ... here; dump both speculative and non-speculative lists. (ipa_devirt): Update for new possible_polymorphic_call_targets API. * ipa-utils.h (possible_polymorphic_call_targets): Update. * testsuite/g++.dg/ipa/devirt-34.C: Update template. From-SVN: r215614
2014-09-25cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; ↵Jan Hubicka1-108/+0
add stream_int and stream_out methods. * cgraph.h (class ipa_polymorphic_call_context): Move here from ipa-utils.h; add stream_int and stream_out methods. (cgraph_indirect_call_info): Remove SPECILATIVE_OFFSET, OUTER_TYPE, SPECULATIVE_OUTER_TYPE, MAYBE_IN_CONSTRUCTION MAYBE_DERIVED_TYPE and SPECULATIEVE_MAYBE_DERIVED_TYPE; add CONTEXT. (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Move here from ipa-utils.h * ipa-utils.h (class ipa_polymorphic_call_context): Move to cgraph.h (ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::ipa_polymorphic_call_context, ipa_polymorphic_call_context::clear_speculation, ipa_polymorphic_call_context::clear_outer_type): Likewise. * ipa-devirt.c: Include data-streamer.h, lto-streamer.h and streamer-hooks.h (ipa_polymorphic_call_context::stream_out): New method. (ipa_polymorphic_call_context::stream_in): New method. (noncall_stmt_may_be_vtbl_ptr_store): Add forgotten static. * ipa-prop.c (ipa_analyze_indirect_call_uses): Do not care about OUTER_TYPE. (ipa_analyze_call_uses): Simplify. (update_indirect_edges_after_inlining): Do not care about outer_type. (ipa_write_indirect_edge_info): Update. (ipa_write_indirect_edge_info): Likewise. * cgraph.c (cgraph_node::create_indirect_edge): Simplify. (dump_edge_flags): Break out from ... (cgraph_node::dump): ... here; dump indirect edges. From-SVN: r215575
2014-09-24ipa-utils.h (polymorphic_call_context): Add metdhos dump, debug and ↵Jan Hubicka1-7/+20
clear_outer_type. * ipa-utils.h (polymorphic_call_context): Add metdhos dump, debug and clear_outer_type. (ipa_polymorphic_call_context::ipa_polymorphic_call_context): Simplify. (ipa_polymorphic_call_context::clear_outer_type): New method. * ipa-prop.c (ipa_analyze_call_uses): Do not overwrite offset. * ipa-devirt.c (types_odr_comparable): New function. (types_must_be_same_for_odr): New function. (odr_subtypes_equivalent_p): Simplify. (possible_placement_new): Break out from ... (ipa_polymorphic_call_context::restrict_to_inner_type): ... here; be more cuatious about returning false in cases the context may be valid in derived type or via placement new. (contains_type_p): Clear maybe_derived_type (ipa_polymorphic_call_context::dump): New method. (ipa_polymorphic_call_context::debug): New method. (ipa_polymorphic_call_context::set_by_decl): Cleanup comment. (ipa_polymorphic_call_context::set_by_invariant): Simplify. (ipa_polymorphic_call_context::ipa_polymorphic_call_context): Simplify. (possible_polymorphic_call_targets): Trust context.restrict_to_inner_class to suceed on all valid cases; remove confused sanity check. (dump_possible_polymorphic_call_targets): Simplify. From-SVN: r215569
2014-09-20ipa-utils.h (ipa_polymorphic_call_context): Turn into class; add ctors.Jan Hubicka1-42/+42
* ipa-utils.h (ipa_polymorphic_call_context): Turn into class; add ctors. (possible_polymorphic_call_targets, dump_possible_polymorphic_call_targets, possible_polymorphic_call_target_p, possible_polymorphic_call_target_p): Simplify. (get_dynamic_type): Remove. * ipa-devirt.c (ipa_dummy_polymorphic_call_context): Remove. (clear_speculation): Bring to ipa-deivrt.h (get_class_context): Rename to ... (ipa_polymorphic_call_context::restrict_to_inner_class): ... this one. (contains_type_p): Update. (get_dynamic_type): Rename to ... ipa_polymorphic_call_context::get_dynamic_type(): ... this one. (possible_polymorphic_call_targets): UPdate. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Update. * ipa-prop.c (ipa_analyze_call_uses): Update. From-SVN: r215418
2014-09-11common.opt (flto-odr-type-merging): New flag.Jan Hubicka1-0/+18
* common.opt (flto-odr-type-merging): New flag. * ipa-deivrt.c (hash_type_name): Use ODR names for hasing if availale. (types_same_for_odr): Likewise. (odr_subtypes_equivalent_p): Likewise. (add_type_duplicate): Do not walk type variants. (register_odr_type): New function. * ipa-utils.h (register_odr_type): Declare. (odr_type_p): New function. * langhooks.c (lhd_set_decl_assembler_name): Do not compute TYPE_DECLs * doc/invoke.texi (-flto-odr-type-merging): Document. * tree.c (need_assembler_name_p): Compute ODR names when asked for it. * tree.h (DECL_ASSEMBLER_NAME): Update comment. * lto.c (lto_read_decls): Register ODR types. From-SVN: r215196
2014-08-16ipa-utils.h (ipa_polymorphic_call_context): Turn into class; add ctors.Jan Hubicka1-24/+58
* ipa-utils.h (ipa_polymorphic_call_context): Turn into class; add ctors. (possible_polymorphic_call_targets, dump_possible_polymorphic_call_targets, possible_polymorphic_call_target_p, possible_polymorphic_call_target_p): Simplify. (get_dynamic_type): Remove. * ipa-devirt.c (ipa_dummy_polymorphic_call_context): Remove. (clear_speculation): Bring to ipa-deivrt.h (get_class_context): Rename to ... (ipa_polymorphic_call_context::restrict_to_inner_class): ... this one. (contains_type_p): Update. (get_dynamic_type): Rename to ... ipa_polymorphic_call_context::get_dynamic_type(): ... this one. (possible_polymorphic_call_targets): UPdate. * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): Update. * ipa-prop.c (ipa_analyze_call_uses): Update. From-SVN: r214060
2014-08-14ipa-utils.h (compare_virtual_tables): Declare.Jan Hubicka1-0/+1
* ipa-utils.h (compare_virtual_tables): Declare. * ipa-devirt.c (odr_subtypes_equivalent_p): New function * lto-symtab.c (lto_varpool_replace_node): Call compare_virtual_tables. From-SVN: r213990
2014-08-07ipa-devirt.c: Include gimple-pretty-print.hJan Hubicka1-1/+1
* ipa-devirt.c: Include gimple-pretty-print.h (referenced_from_vtable_p): Exclude DECL_EXTERNAL from further tests. (decl_maybe_in_construction_p): Fix conditional on cdtor check (get_polymorphic_call_info): Fix return value (type_change_info): New sturcture based on ipa-prop variant. (noncall_stmt_may_be_vtbl_ptr_store): New predicate based on ipa-prop variant. (extr_type_from_vtbl_ptr_store): New function based on ipa-prop variant. (record_known_type): New function. (check_stmt_for_type_change): New function. (get_dynamic_type): New function. * ipa-prop.c (ipa_analyze_call_uses): Use get_dynamic_type. * tree-ssa-pre.c: ipa-utils.h (eliminate_dom_walker::before_dom_children): Use ipa-devirt machinery; sanity check with ipa-prop devirtualization. * trans-mem.c (ipa_tm_insert_gettmclone_call): Clear polymorphic flag. * g++.dg/ipa/devirt-35.C: New testcase. * g++.dg/ipa/devirt-36.C: New testcase. From-SVN: r213739