From d0f7fc76d5dac5f4c3c57a2e632082485debbd8a Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Thu, 8 Jan 2015 13:49:45 +0100
Subject: [PATCH] IPA ICF: handle correctly indirect_calls.
gcc/ChangeLog:
2015-01-08 Martin Liska <mliska@suse.cz>
* ipa-icf.c (sem_function::equals_wpa): Add indirect_calls as indication
that a function is not leaf.
(sem_function::compare_polymorphic_p): Likewise.
---
gcc/ipa-icf.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
@@ -340,7 +340,8 @@ sem_function::equals_wpa (sem_item *item,
return return_false_with_msg ("NULL argument type");
/* Polymorphic comparison is executed just for non-leaf functions. */
- bool is_not_leaf = get_node ()->callees != NULL;
+ bool is_not_leaf = get_node ()->callees != NULL
+ || get_node ()->indirect_calls != NULL;
if (!func_checker::compatible_types_p (arg_types[i],
m_compared_func->arg_types[i],
@@ -884,7 +885,9 @@ bool
sem_function::compare_polymorphic_p (void)
{
return get_node ()->callees != NULL
- || m_compared_func->get_node ()->callees != NULL;
+ || get_node ()->indirect_calls != NULL
+ || m_compared_func->get_node ()->callees != NULL
+ || m_compared_func->get_node ()->indirect_calls != NULL;
}
/* For a given call graph NODE, the function constructs new
--
2.1.2