From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88241 invoked by alias); 1 Apr 2016 15:07:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 88222 invoked by uid 89); 1 Apr 2016 15:07:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1260, mistaken, H*MI:sk:2016040 X-Spam-User: qpsmtpd, 2 recipients 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 01 Apr 2016 15:07:27 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1am0fV-00031G-1E from Cesar_Philippidis@mentor.com ; Fri, 01 Apr 2016 08:07:25 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.224.2; Fri, 1 Apr 2016 08:07:24 -0700 Subject: Re: [patch] Fortran fix for PR70289 To: Jakub Jelinek References: <56FE8A6C.2000004@codesourcery.com> <20160401145600.GX3017@tucnak.redhat.com> CC: "gcc-patches@gcc.gnu.org" , Fortran List From: Cesar Philippidis Message-ID: <56FE8EAC.3070402@codesourcery.com> Date: Fri, 01 Apr 2016 15:07:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160401145600.GX3017@tucnak.redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00048.txt.bz2 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? Cesar