From patchwork Mon Dec 22 11:12:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 423355 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AF55614007D for ; Mon, 22 Dec 2014 22:12:19 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; q=dns; s=default; b=PQY0rY0OR8XdpZu3h Y58wUocyrgjttKiHA4+vO9sGZ/Y1W7ihB3B/bkq5uFLJYnPH2vsPTJ8VmQIopaqa DtzPDDyyKVhgZEXiYSdaS3omi0EoHJotVaX22SeVm/5b8IjB27OepD4ySOORkoKa m9z6hKIMi21e4TGbFpFPLjJmZc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type; s=default; bh=z3s/o7kIJHzkNFi4U5+eA7A 93DA=; b=uSP+rA87PSwuTiuT3suSaABMFArS0x11A68OHg0eHpX2dwENcK8gS9+ QzgDzjf3eRKIzts9qkhiHEWY0ERb3ienVQIUUPJYQ4bwTJ3kJbNps4SDZu1epmfE ElOmzCAXcIF1oBO7bpMO88vHlOwXmOLhshVh2phYcn7MX7gFqmLA= Received: (qmail 32698 invoked by alias); 22 Dec 2014 11:12:12 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 32685 invoked by uid 89); 22 Dec 2014 11:12:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 22 Dec 2014 11:12:11 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DC6C0AC1A for ; Mon, 22 Dec 2014 11:12:07 +0000 (UTC) Message-ID: <5497FC87.90305@suse.cz> Date: Mon, 22 Dec 2014 12:12:07 +0100 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] IPA ICF: Fix for PR ipa/63851 and ipa/63852. References: <5497EA36.8070707@suse.cz> In-Reply-To: <5497EA36.8070707@suse.cz> X-IsSubscribed: yes On 12/22/2014 10:53 AM, Martin Liška wrote: > 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 In previous mail, I forgot to add one obvious hunk that is quite obvious. Thanks, Martin From a32fceb4af65a21b3b3d48cd3d981bcbe6faa8ab Mon Sep 17 00:00:00 2001 From: mliska 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 PR ipa/63851 PR ipa/63852 * ipa-icf.c (sem_function::merge): Ignore merge operation for a thunk created from static chain. * ipa-icf-gimple.c (func_checker::compatible_types_p): Verify that types have same restrict flag. --- gcc/ipa-icf-gimple.c | 3 +++ gcc/ipa-icf.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index fa2c353..6689463 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -185,6 +185,9 @@ bool func_checker::compatible_types_p (tree t1, tree t2, if (TREE_CODE (t1) != TREE_CODE (t2)) return return_false_with_msg ("different tree types"); + if (TYPE_RESTRICT (t1) != TYPE_RESTRICT (t2)) + return return_false_with_msg ("restrict flags are different"); + if (!types_compatible_p (t1, t2)) return return_false_with_msg ("types are not compatible"); 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