gcc/ChangeLog: 2019-07-24 Martin Liska <mli...@suse.cz>
* ipa-icf-gimple.c (func_checker::func_checker): Do not initialize m_compare_polymorphic. (func_checker::compare_decl): Do not compare polymorphic types. * ipa-icf-gimple.h (m_compare_polymorphic): Remove. * ipa-icf.c (sem_function::equals_private): Do not call compare_polymorphic_p. --- gcc/ipa-icf-gimple.c | 18 ------------------ gcc/ipa-icf-gimple.h | 4 ---- gcc/ipa-icf.c | 1 - 3 files changed, 23 deletions(-)
diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index 2d4c5d22534..375aadad412 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -51,14 +51,12 @@ namespace ipa_icf_gimple { of declarations that can be skipped. */ func_checker::func_checker (tree source_func_decl, tree target_func_decl, - bool compare_polymorphic, bool ignore_labels, hash_set<symtab_node *> *ignored_source_nodes, hash_set<symtab_node *> *ignored_target_nodes) : m_source_func_decl (source_func_decl), m_target_func_decl (target_func_decl), m_ignored_source_nodes (ignored_source_nodes), m_ignored_target_nodes (ignored_target_nodes), - m_compare_polymorphic (compare_polymorphic), m_ignore_labels (ignore_labels) { function *source_func = DECL_STRUCT_FUNCTION (source_func_decl); @@ -156,23 +154,7 @@ func_checker::compare_decl (tree t1, tree t2) if (!compatible_types_p (TREE_TYPE (t1), TREE_TYPE (t2))) return return_false (); - /* TODO: we are actually too strict here. We only need to compare if - T1 can be used in polymorphic call. */ - if (TREE_ADDRESSABLE (t1) - && m_compare_polymorphic - && !compatible_polymorphic_types_p (TREE_TYPE (t1), TREE_TYPE (t2), - false)) - return return_false (); - - if ((t == VAR_DECL || t == PARM_DECL || t == RESULT_DECL) - && DECL_BY_REFERENCE (t1) - && m_compare_polymorphic - && !compatible_polymorphic_types_p (TREE_TYPE (t1), TREE_TYPE (t2), - true)) - return return_false (); - bool existed_p; - tree &slot = m_decl_map.get_or_insert (t1, &existed_p); if (existed_p) return return_with_debug (slot == t2); diff --git a/gcc/ipa-icf-gimple.h b/gcc/ipa-icf-gimple.h index b760b0fdce3..75f2f24ff4a 100644 --- a/gcc/ipa-icf-gimple.h +++ b/gcc/ipa-icf-gimple.h @@ -128,7 +128,6 @@ public: Similarly, IGNORE_SOURCE_DECLS and IGNORE_TARGET_DECLS are sets of declarations that can be skipped. */ func_checker (tree source_func_decl, tree target_func_decl, - bool compare_polymorphic, bool ignore_labels = false, hash_set<symtab_node *> *ignored_source_nodes = NULL, hash_set<symtab_node *> *ignored_target_nodes = NULL); @@ -258,9 +257,6 @@ private: /* Label to basic block index mapping. */ hash_map <tree, int> m_label_bb_map; - /* Flag if polymorphic comparison should be executed. */ - bool m_compare_polymorphic; - /* Flag if ignore labels in comparison. */ bool m_ignore_labels; diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 7cac480930b..f6400d48e27 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -845,7 +845,6 @@ sem_function::equals_private (sem_item *item) return return_false (); m_checker = new func_checker (decl, m_compared_func->decl, - compare_polymorphic_p (), false, &refs_set, &m_compared_func->refs_set);