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