From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) by sourceware.org (Postfix) with ESMTPS id 86C9C383A304 for ; Mon, 25 Jul 2022 18:08:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 86C9C383A304 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr Received: from [192.168.1.17] ([86.215.161.154]) by smtp.orange.fr with ESMTPA id G2VLoBwBeClE7G2VLomMPM; Mon, 25 Jul 2022 20:08:32 +0200 X-ME-Helo: [192.168.1.17] X-ME-Auth: MDU4MTIxYWM4YWI0ZGE4ZTUwZWZmNTExZmI2ZWZlMThkM2ZhYiE5OWRkOGM= X-ME-Date: Mon, 25 Jul 2022 20:08:32 +0200 X-ME-IP: 86.215.161.154 Message-ID: Date: Mon, 25 Jul 2022 20:08:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 From: Mikael Morin Subject: Re: [PATCH] Fortran: fix invalid rank error in ASSOCIATED when rank is remapped [PR77652] To: Harald Anlauf Cc: fortran , gcc-patches References: <8e300265-e24c-59c2-19b0-3d74fc5ed425@orange.fr> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, FREEMAIL_FROM, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2022 18:08:40 -0000 Le 25/07/2022 à 18:01, Harald Anlauf a écrit : > Hi Mikael, all, > > a discussion in the Intel compiler forum suggests that the F2018 > standard prohibits such use of the ASSOCIATED intrinsic. > > https://community.intel.com/t5/Intel-Fortran-Compiler/Intel-rejects-ASSOCIATED-pointer-target-for-non-equal-ranks/m-p/1402799/highlight/true#M162159 > I disagree with the conclusion. Quoting Steve Lionel’s post: > What you're missing is this: > > TARGET (optional) shall be allowable as the data-target or proc-target in a pointer assignment statement (10.2.2) in which POINTER is data-pointer-object or proc-pointer-object. > > We then go to 10.2.2 which says (emphasis mine): > > C1019 (R1033) If bounds-remapping-list is not specified, the ranks of data-pointer-object and data-target shall be the same. > > So... not valid Fortran 2018. except, that there is also this: > C1018 (R1033) If bounds-remapping-list is specified, the number of bounds-remappings shall equal the rank of data-pointer-object. which practically imposes no conformance rule between data-pointer-object and data-target. Note that in the syntax definition, bounds-remapping-list is not part of data-pointer-object. In other words, by collating a bounds-remapping-list next to POINTER, one can construct an allowable pointer assignment from TARGET to POINTER, which satisfies the requirement, even if TARGET and POINTER don’t have the same rank.