From patchwork Fri Apr 18 13:08:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 340298 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 03E251400E5 for ; Fri, 18 Apr 2014 23:08:22 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=jAgpRGCve02DVxslz 9whAhuk16+kayTc1LNEnznIvgxb5nQnZlrdNd+hKw9APcnlE4wXC9aIeCX+4le4i Jy+B99xdMjX+7+gxsLiJI8EKvtSJTZNa8vjqxtgyYZh05CK7sUeUyfdyW9WZ9zCZ wGvDQ/dq9H+pgy2UdfgFe4EQ5E= 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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=kq+E5LS2HXY179mRAtFZmHC kKeg=; b=Bsg5JkE6k+t7AzNtTCLyv2z/VWyuzqETRAx95gsr/p+JiYp7yP6l+yn aS3dDAQQgmDxzhTzNfsnrnj0Hebvrf5HI8igGYBYvx5J55tO1E5axTR4Blq5qjGL g+rgGRvfqhpOHdurjXuw0A+oso3ZMs/PBvH8cMK3yrEPZf/IUyKg= Received: (qmail 11998 invoked by alias); 18 Apr 2014 13:08:15 -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 11988 invoked by uid 89); 18 Apr 2014 13:08:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.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; Fri, 18 Apr 2014 13:08:14 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4E717AD02; Fri, 18 Apr 2014 13:08:10 +0000 (UTC) Date: Fri, 18 Apr 2014 15:08:09 +0200 From: Martin Jambor To: Jakub Jelinek Cc: "Zamyatin, Igor" , GCC Patches , Jan Hubicka Subject: Re: [PATCH] Do not run IPA transform phases multiple times Message-ID: <20140418130809.GB12215@virgil.suse> Mail-Followup-To: Jakub Jelinek , "Zamyatin, Igor" , GCC Patches , Jan Hubicka References: <20140414173646.GE8020@virgil.suse> <0EFAB2BDD0F67E4FB6CCC8B9F87D756942A01047@IRSMSX103.ger.corp.intel.com> <20140418101145.GY1817@tucnak.redhat.com> <20140418113354.GA12215@virgil.suse> <20140418114936.GC1817@tucnak.redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140418114936.GC1817@tucnak.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes On Fri, Apr 18, 2014 at 01:49:36PM +0200, Jakub Jelinek wrote: > It reproduces on x86_64 too, I guess the reason why you aren't seeing this > is that you might have too old assembler that doesn't support > avx2 instructions (you actually don't need avx2 hw to reproduce, any > x86_64 or i686 just with gas that supports avx2 should be enough). > I see, with that information I have managed to reproduce the failures and now am convinced the patch (re-posted below) is indeed the correct thing to do. I am going to bootstrap it over the weekend (can't do it earlier to test these testcases). Honza, is it OK for trunk if it passes? Thanks, Martin 2014-04-18 Martin Jambor * cgraphclones.c (cgraph_function_versioning): Copy ipa_transforms_to_apply instead of asserting it is empty. Index: src/gcc/cgraphclones.c =================================================================== --- src.orig/gcc/cgraphclones.c +++ src/gcc/cgraphclones.c @@ -974,7 +974,9 @@ cgraph_function_versioning (struct cgrap cgraph_copy_node_for_versioning (old_version_node, new_decl, redirect_callers, bbs_to_copy); - gcc_assert (!old_version_node->ipa_transforms_to_apply.exists ()); + if (old_version_node->ipa_transforms_to_apply.exists ()) + new_version_node->ipa_transforms_to_apply + = old_version_node->ipa_transforms_to_apply.copy (); /* Copy the OLD_VERSION_NODE function tree to the new version. */ tree_function_versioning (old_decl, new_decl, tree_map, false, args_to_skip, skip_return, bbs_to_copy, new_entry_block);