From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96711 invoked by alias); 1 Apr 2016 15:17:43 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 94851 invoked by uid 89); 1 Apr 2016 15:17:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 01 Apr 2016 15:17:41 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 77C1B8E36C; Fri, 1 Apr 2016 15:17:40 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-113-22.phx2.redhat.com [10.3.113.22]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u31FHc3b012782 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 1 Apr 2016 11:17:40 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u31FHa9I023617; Fri, 1 Apr 2016 17:17:37 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u31FHZNT023614; Fri, 1 Apr 2016 17:17:35 +0200 Date: Fri, 01 Apr 2016 15:17:00 -0000 From: Jakub Jelinek To: Cesar Philippidis Cc: "gcc-patches@gcc.gnu.org" , Fortran List Subject: Re: [patch] Fortran fix for PR70289 Message-ID: <20160401151735.GA3017@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <56FE8A6C.2000004@codesourcery.com> <20160401145600.GX3017@tucnak.redhat.com> <56FE8EAC.3070402@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56FE8EAC.3070402@codesourcery.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2016-04/txt/msg00004.txt.bz2 On Fri, Apr 01, 2016 at 08:07:24AM -0700, Cesar Philippidis wrote: > On 04/01/2016 07:56 AM, Jakub Jelinek wrote: > > On Fri, Apr 01, 2016 at 07:49:16AM -0700, Cesar Philippidis wrote: > >> The bug in PR70289 is an assertion failure triggered by a static > >> variable used inside an offloaded acc region which doesn't have a data > >> clause associated with it. Basically, that static variable ends up in a > >> different lto partition, which was not streamed to the offloaded > >> compiler. I'm not sure if we should try to replicate the static storage > >> in the offloaded regions, but it probably doesn't make sense in a > >> parallel environment anyway. > > > > Is this really Fortran specific? I'd expect the diagnostics to be in > > gimplify.c and handle it for all 3 FEs... > > By the time the variable reaches the gimplifier, the reduction variable > may no longer match the ones inside the data clause. E.g. consider this > directive inside a fortran subroutine: > > !$acc parallel copyout(temp) reduction(+:temp) > > The gimplifier would see something like: > > map(force_from:*temp.2 [len: 4]) map(alloc:temp [pointer assign, bias: > 0]) reduction(+:temp) > > At this point, unless I'm mistaken, it would be difficult to tell if > temp.2 is a pointer to the same temp in the reduction. Maybe I'm missing > something? All the info is still there, and this wouldn't be the only case where we rely on exact clause ordering. I think that is still much better than doing it in all the FEs. Jakub