diff mbox

IPA ICF: Fix for PR ipa/63851 and ipa/63852.

Message ID 5497EA36.8070707@suse.cz
State New
Headers show

Commit Message

Martin Liška Dec. 22, 2014, 9:53 a.m. UTC
Hello.

Following IPA ICF patch restricts thunk creation for static-chain thunks.
Patch can bootstrap on x86_64-linux-pc and no new regression has been seen.

Ready for thunk?
Thanks,
Martin

Comments

Jan Hubicka Dec. 22, 2014, 3:21 p.m. UTC | #1
> Hello.
> 
> Following IPA ICF patch restricts thunk creation for static-chain thunks.
> Patch can bootstrap on x86_64-linux-pc and no new regression has been seen.
> 
> Ready for thunk?
> Thanks,
> Martin

> >From b247009735cd294b3fd8b727905cb47b5cdaeb51 Mon Sep 17 00:00:00 2001
> From: mliska <mliska@suse.cz>
> Date: Mon, 22 Dec 2014 10:46:41 +0100
> Subject: [PATCH] IPA ICF: Fix for PR ipa/63851 and ipa/63852.
> 
> gcc/ChangeLog:
> 
> 2014-12-22  Martin Liska  <mliska@suse.cz>
> 
> 	PR ipa/63851
> 	PR ipa/63852
> 	* ipa-icf.c (sem_function::merge): Ignore merge operation
> 	for a thunk created from static chain.

OK.
Please add also the code to match TARGET_OPTION and OPTIMIZATION nodes
Honza
> ---
>  gcc/ipa-icf.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
> index 6cdc21b..b8ef6e0 100644
> --- a/gcc/ipa-icf.c
> +++ b/gcc/ipa-icf.c
> @@ -694,6 +694,14 @@ sem_function::merge (sem_item *alias_item)
>  	  return 0;
>  	}
>  
> +      if (DECL_STATIC_CHAIN (alias->decl))
> +        {
> +         if (dump_file)
> +           fprintf (dump_file, "Thunk creation is risky for static-chain functions.\n\n");
> +
> +         return 0;
> +        }
> +
>        alias->icf_merged = true;
>        ipa_merge_profiles (local_original, alias);
>        alias->create_wrapper (local_original);
> -- 
> 2.1.2
>
diff mbox

Patch

From b247009735cd294b3fd8b727905cb47b5cdaeb51 Mon Sep 17 00:00:00 2001
From: mliska <mliska@suse.cz>
Date: Mon, 22 Dec 2014 10:46:41 +0100
Subject: [PATCH] IPA ICF: Fix for PR ipa/63851 and ipa/63852.

gcc/ChangeLog:

2014-12-22  Martin Liska  <mliska@suse.cz>

	PR ipa/63851
	PR ipa/63852
	* ipa-icf.c (sem_function::merge): Ignore merge operation
	for a thunk created from static chain.
---
 gcc/ipa-icf.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 6cdc21b..b8ef6e0 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -694,6 +694,14 @@  sem_function::merge (sem_item *alias_item)
 	  return 0;
 	}
 
+      if (DECL_STATIC_CHAIN (alias->decl))
+        {
+         if (dump_file)
+           fprintf (dump_file, "Thunk creation is risky for static-chain functions.\n\n");
+
+         return 0;
+        }
+
       alias->icf_merged = true;
       ipa_merge_profiles (local_original, alias);
       alias->create_wrapper (local_original);
-- 
2.1.2