This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR ipa/65665


On 04/03/2015 07:19 PM, Jan Hubicka wrote:
Hello.

Following patch fixes a new issue, ICE has disappeared on aarch64-linux machine and I was able to boostrap on
the machine. Moreover, no new regression seen on x86_64-linux-pc.

Ready for trunk?
Thanks,
Martin

>From b8463b8a7b2f6b652d6d9c3a2ece814ec5554619 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Fri, 3 Apr 2015 09:30:50 +0200
Subject: [PATCH] Fix PR ipa/65665

gcc/ChangeLog:

2015-04-03  Martin Liska  <mliska@suse.cz>

	PR ipa/65665
	* ipa-icf.c (sem_function::equals_wpa): Verify that IPA CP
	has computed data structure.
	(sem_item_optimizer::update_hash_by_addr_refs): Likewise.

OK,
we should clean this up next stage1 ideally making passmanager to do the ipa-prop
analysis and making them trigger for all ipa passes consuming them
(ipa-icf/ipa-cp/inliner). Currently the way they are initialized either by inliner
or ipa-cp is quite ugly.

Hi.

Agree with you, this problem shows how closely are individual passes connected
and how hard is it to split a pass to LGEN, WPA and LTRANS phase :)

Martin


Honza
---
  gcc/ipa-icf.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 8626730..8f8a0cf 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -535,7 +535,8 @@ sem_function::equals_wpa (sem_item *item,
        && (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE
            || TREE_CODE (TREE_TYPE (item->decl)) == METHOD_TYPE)
        && (ipa_node_params_sum == NULL
-	  || ipa_is_param_used (IPA_NODE_REF (dyn_cast <cgraph_node *>(node)),
+	  || IPA_NODE_REF (get_node ())->descriptors.is_empty ()
+	  || ipa_is_param_used (IPA_NODE_REF (get_node ()),
  				0))
        && compare_polymorphic_p ())
      {
@@ -2501,14 +2502,15 @@ sem_item_optimizer::update_hash_by_addr_refs ()
        m_items[i]->update_hash_by_addr_refs (m_symtab_node_map);
        if (m_items[i]->type == FUNC)
  	{
+	  cgraph_node *cnode = dyn_cast <cgraph_node *> (m_items[i]->node);
+
  	  if (TREE_CODE (TREE_TYPE (m_items[i]->decl)) == METHOD_TYPE
  	      && contains_polymorphic_type_p
  		   (method_class_type (TREE_TYPE (m_items[i]->decl)))
  	      && (DECL_CXX_CONSTRUCTOR_P (m_items[i]->decl)
  		  || ((ipa_node_params_sum == NULL
-		       || ipa_is_param_used (
-			    IPA_NODE_REF
-			      (dyn_cast <cgraph_node *>(m_items[i]->node)), 0))
+		       || IPA_NODE_REF (cnode)->descriptors.is_empty ()
+		       || ipa_is_param_used (IPA_NODE_REF (cnode), 0))
  		      && static_cast<sem_function *> (m_items[i])
  			   ->compare_polymorphic_p ())))
  	     {
--
2.1.4




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]