public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR ipa/65665
@ 2015-04-03  8:45 Martin Liška
  2015-04-03 17:19 ` Jan Hubicka
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2015-04-03  8:45 UTC (permalink / raw)
  To: GCC Patches; +Cc: Jan Hubicka

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

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

[-- Attachment #2: 0001-Fix-PR-ipa-65665.patch --]
[-- Type: text/x-patch, Size: 1896 bytes --]

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.
---
 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix PR ipa/65665
  2015-04-03  8:45 [PATCH] Fix PR ipa/65665 Martin Liška
@ 2015-04-03 17:19 ` Jan Hubicka
  2015-04-07 20:25   ` Martin Liška
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Hubicka @ 2015-04-03 17:19 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches, Jan Hubicka

> 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.

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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix PR ipa/65665
  2015-04-03 17:19 ` Jan Hubicka
@ 2015-04-07 20:25   ` Martin Liška
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2015-04-07 20:25 UTC (permalink / raw)
  To: gcc-patches

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-07 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-03  8:45 [PATCH] Fix PR ipa/65665 Martin Liška
2015-04-03 17:19 ` Jan Hubicka
2015-04-07 20:25   ` Martin Liška

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).