From: Martin Liska Date: Mon, 12 Jan 2015 09:59:39 +0000 (+0100) Subject: IPA ICF: handle correctly indirect_calls. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1c928ddc69d2f9c9ff2105635a666d82c2e0ee98;p=gcc.git IPA ICF: handle correctly indirect_calls. * ipa-icf.c (sem_function::equals_wpa): Add indirect_calls as indication that a function is not leaf. (sem_function::compare_polymorphic_p): Likewise. From-SVN: r219456 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c820cdd240..3205cec4a95 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-01-12 Martin Liska + + * ipa-icf.c (sem_function::equals_wpa): Add indirect_calls as indication + that a function is not leaf. + (sem_function::compare_polymorphic_p): Likewise. + 2015-01-12 Prathamesh Kulkarni * config/visium/visium.c: Add includes hashtab.h, hash-set.h, diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 4ccaf8cb90f..9e2dea5397d 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -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