+2019-10-30 Martin Liska <mliska@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.
+
2019-10-30 Martin Liska <mliska@suse.cz>
* ipa-icf-gimple.c (func_checker::compare_ssa_name): Call
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);
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);
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);
/* 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;