diff mbox

IPA ICF: handle correctly indirect_calls

Message ID 54B39408.5060402@suse.cz
State New
Headers show

Commit Message

Martin Liška Jan. 12, 2015, 9:29 a.m. UTC
Hello.

Following patch is needed to pass LTO compilation for chromium. IPA ICF verifies polymorphic types
for functions that have any function call. I forgot to handle indirect_calls.

Patch can bootstrap on x86_64-linux-pc and new regression is seen.
Ready for trunk?

Thanks,
Martin

Comments

Richard Biener Jan. 12, 2015, 9:45 a.m. UTC | #1
On Mon, Jan 12, 2015 at 10:29 AM, Martin Liška <mliska@suse.cz> wrote:
> Hello.
>
> Following patch is needed to pass LTO compilation for chromium. IPA ICF
> verifies polymorphic types
> for functions that have any function call. I forgot to handle
> indirect_calls.
>
> Patch can bootstrap on x86_64-linux-pc and new regression is seen.
> Ready for trunk?

Ok.

Thanks,
Richard.

> Thanks,
> Martin
diff mbox

Patch

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(-)

diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 1b76a1d..ed6d019 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
-- 
2.1.2