From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105567 invoked by alias); 19 Mar 2015 19:00:47 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 105550 invoked by uid 89); 19 Mar 2015 19:00:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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; Thu, 19 Mar 2015 19:00:46 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2JJ0ihW032104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 19 Mar 2015 15:00:44 -0400 Received: from tucnak.zalov.cz (ovpn-116-63.ams2.redhat.com [10.36.116.63]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2JJ0gr5029176 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 19 Mar 2015 15:00:44 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t2JJ0fF4026929; Thu, 19 Mar 2015 20:00:41 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t2JJ0eSM026928; Thu, 19 Mar 2015 20:00:40 +0100 Date: Thu, 19 Mar 2015 19:00:00 -0000 From: Jakub Jelinek To: Ilya Verbin Cc: gcc@gcc.gnu.org, Kirill Yukhin Subject: Re: [gomp4] Questions about "declare target" and "target update" pragmas Message-ID: <20150319190040.GC1746@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20140122155151.GA50489@msticlxl57.ims.intel.com> <20150310165252.GC37666@msticlxl57.ims.intel.com> <20150316184153.GA42550@msticlxl57.ims.intel.com> <20150319134744.GW1746@tucnak.redhat.com> <20150319144947.GA20881@msticlxl57.ims.intel.com> <20150319145710.GY1746@tucnak.redhat.com> <20150319184258.GB20881@msticlxl57.ims.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150319184258.GB20881@msticlxl57.ims.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg00238.txt.bz2 On Thu, Mar 19, 2015 at 09:42:58PM +0300, Ilya Verbin wrote: > Ok, got it. > > And what about global allocatable fortran arrays? I didn't find any > restrictions in the specification. Here is a reduced testcase: This really can't be supported. If you have global allocatables, you really should allocate them in the target IMNSHO. The allocation on the host doesn't make it allocated on the target. Otherwise, how you could e.g. deallocate it on the target or allocate again? > > module test > integer, allocatable, target :: x(:) > !$omp declare target(x) > end module test > use test > integer :: n = 1000 > allocate (x(n)) > !$omp target map(x(1:n)) > x(123) = 456 > !$omp end target > deallocate (x) > end > > It crashes on target with NULL-pointer access, however the memory for x(1:n) is > allocated on target. Looks like there's something wrong with pointer > transformation. Is this a wrong testcase or a bug in gcc? Jakub