From patchwork Wed Sep 3 19:21:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 385625 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 F3AA314018E for ; Thu, 4 Sep 2014 05:24:51 +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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=lDMXEVZu4r8o1btQ cQrAjWwmXXj7rU9pc5t3TjySmoA/zp43kndsCLWXsvVi6+knXfPt6oKX/aMUBv44 oZgycsetbmnQ9khqWHWFgqL1LhsbkBkmCWRm1STUiAYdsP26pT7ZZBGHePHwtKHJ Be6qsZjG8yU3PsiVZy+t8dxiPHg= 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:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=LPFDLxMh3bHEJgYf1OYxJy grPNc=; b=pn+XsITx/jpCqhvW5qFVGl4st0y5njYCGFW/1MBRnTz+/Rxrr/OLjM hS0kX42uETBqZfg1H5PlgiBviJtF0uqZuo/O7kj8iE/O9eXLhjyj1PmUfHjhsnDp s/09srxQm3OlfWDvyNyPVt4AbKzoe31QHOir11mhqbWh2x3V85/Fc= Received: (qmail 27063 invoked by alias); 3 Sep 2014 19:24:41 -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 27052 invoked by uid 89); 3 Sep 2014 19:24:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 03 Sep 2014 19:24:38 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1XPGAP-0004vJ-LI from Thomas_Schwinge@mentor.com ; Wed, 03 Sep 2014 12:24:32 -0700 Received: from tftp-cs (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Wed, 3 Sep 2014 12:21:22 -0700 Received: by tftp-cs (Postfix, from userid 49978) id 3B68BC2203; Wed, 3 Sep 2014 12:21:22 -0700 (PDT) From: Thomas Schwinge To: Ilya Verbin CC: Jakub Jelinek , GCC Patches , Bernd Schmidt Subject: Re: [gomp4] Add tables generation In-Reply-To: <20140818160759.GA60399@msticlxl57.ims.intel.com> References: <532B1C45.9020308@codesourcery.com> <20140327133129.GA1618@msticlxl57.ims.intel.com> <20140327140218.GZ1817@tucnak.redhat.com> <20140327161300.GA18191@msticlxl57.ims.intel.com> <20140327161651.GC1817@tucnak.redhat.com> <20140417183329.GA16810@msticlxl57.ims.intel.com> <53970DA3.20809@codesourcery.com> <20140610180658.GA27730@msticlxl57.ims.intel.com> <20140813161914.GA26226@msticlxl57.ims.intel.com> <20140818160759.GA60399@msticlxl57.ims.intel.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Wed, 3 Sep 2014 21:21:09 +0200 Message-ID: <8761h4h5ne.fsf@schwinge.name> MIME-Version: 1.0 Hi! On Mon, 18 Aug 2014 20:07:59 +0400, Ilya Verbin wrote: > I discovered an issue in the LTO streaming out for target - currently any file (even without any pragma) compiled with -fopenmp/-fopenacc contains .gnu.target_lto_* sections. This increases the size of an object file and makes lto-wrapper to run mkoffload. > > Therefore, I propose to replace the condition before ipa_write_summaries: > - if (flag_openacc || flag_openmp) > + if ((flag_openacc || flag_openmp) && !(vec_safe_is_empty (offload_funcs) && vec_safe_is_empty (offload_vars))) > > But to do this, the offload_vars must be filled before the check (offload_funcs is already filled in expand_omp_target). > Here is the updated patch. Bootstrap passed. OK for gomp-4_0-branch? > > > On 13 Aug 20:19, Ilya Verbin wrote: > > Here is the updated patch. offload_funcs/vars are now declared in omp-low.h, > > the functions have a comment. Also it fixes the issue of offload_funcs/vars > > corruption by the garbage collector. OK for gomp-4_0-branch? > --- a/gcc/omp-low.c > +++ b/gcc/omp-low.c > @@ -8906,6 +8909,9 @@ expand_omp_target (struct omp_region *region) > DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties; > cgraph_add_new_function (child_fn, true); > > + /* Add the new function to the offload table. */ > + vec_safe_push (offload_funcs, child_fn); > + > /* Fix the callgraph edges for child_cfun. Those for cfun will be > fixed in a following pass. */ > push_cfun (child_cfun); The same change needs to be done for OpenACC offloading; addressed in r214892: commit 9fb900482bd3bca9bfa89301e417174caabd7176 Author: tschwinge Date: Wed Sep 3 19:10:43 2014 +0000 Restore OpenACC offloading. gcc/ * omp-low.c (expand_oacc_offload): Add child_fn to offload_funcs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@214892 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.gomp | 4 ++++ gcc/omp-low.c | 3 +++ 2 files changed, 7 insertions(+) Grüße, Thomas diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp index 40688df..0c55814 100644 --- gcc/ChangeLog.gomp +++ gcc/ChangeLog.gomp @@ -1,3 +1,7 @@ +2014-09-03 Thomas Schwinge + + * omp-low.c (expand_oacc_offload): Add child_fn to offload_funcs. + 2014-08-19 Ilya Verbin * Makefile.in (GTFILES): Add omp-low.h. diff --git gcc/omp-low.c gcc/omp-low.c index 1ad98ab..6ed8239 100644 --- gcc/omp-low.c +++ gcc/omp-low.c @@ -5351,6 +5351,9 @@ expand_oacc_offload (struct omp_region *region) DECL_STRUCT_FUNCTION (child_fn)->curr_properties = cfun->curr_properties; cgraph_add_new_function (child_fn, true); + /* Add the new function to the offload table. */ + vec_safe_push (offload_funcs, child_fn); + /* Fix the callgraph edges for child_cfun. Those for cfun will be fixed in a following pass. */ push_cfun (child_cfun);