From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71350 invoked by alias); 18 May 2018 13:42:47 -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 71335 invoked by uid 89); 18 May 2018 13:42:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:726, H*r:0700 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; Fri, 18 May 2018 13:42:45 +0000 Received: from svr-orw-mbx-04.mgc.mentorg.com ([147.34.90.204]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1fJfec-0006HQ-IT from Cesar_Philippidis@mentor.com ; Fri, 18 May 2018 06:42:42 -0700 Received: from [127.0.0.1] (147.34.91.1) by SVR-ORW-MBX-04.mgc.mentorg.com (147.34.90.204) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 18 May 2018 06:42:39 -0700 Subject: Re: non-contiguous target error To: Arjen Markus , Fortran List References: <107dda2c-b65a-ad4e-b613-81b28f941149@mentor.com> From: Cesar Philippidis Message-ID: <4e887ef6-73d6-95c7-4dab-6fe81e6850af@mentor.com> Date: Fri, 18 May 2018 13:42:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-02.mgc.mentorg.com (147.34.90.202) To SVR-ORW-MBX-04.mgc.mentorg.com (147.34.90.204) X-SW-Source: 2018-05/txt/msg00050.txt.bz2 On 05/18/2018 02:08 AM, Arjen Markus wrote: >> I noticed that gfortran 8 now errors when contiguous pointers point >> to non-explicitly contiguous targets. E.g. >> >> program test implicit none real,pointer :: p1(:) >> real,pointer,contiguous :: p2(:,:,:) >> >> allocate(p1(12)) >> >> p2(1:2,1:2,1:2) => p1(4:) end program >> >> This behavior seems to be too strict. Maybe it should be a >> warning? >> > > I do not have gfortran 8 available, so I cannot check my idea, but > the array section p1(4:) is 9 elements long and the pointer p2 is 8 > elements. Could the error message come from that discrepancy? Good point, but the program still fails when I allocate 20 elements for p1. Cesar