From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cc-smtpout1.netcologne.de (cc-smtpout1.netcologne.de [IPv6:2001:4dd0:100:1062:25:2:0:1]) by sourceware.org (Postfix) with ESMTPS id 6D8F7384A4BF for ; Mon, 1 Feb 2021 07:42:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6D8F7384A4BF Received: from cc-smtpin2.netcologne.de (cc-smtpin2.netcologne.de [89.1.8.202]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id B29E613648; Mon, 1 Feb 2021 08:42:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin2.netcologne.de (Postfix) with ESMTP id AF19411F35; Mon, 1 Feb 2021 08:42:23 +0100 (CET) Received: from [2001:4dd7:5f0c:0:ebfe:ef2f:886e:a511] (helo=cc-smtpin2.netcologne.de) by localhost with ESMTP (eXpurgate 4.19.0) (envelope-from ) id 6017b0df-0254-7f0000012729-7f000001c982-1 for ; Mon, 01 Feb 2021 08:42:23 +0100 Received: from linux-p51k.fritz.box (2001-4dd7-5f0c-0-ebfe-ef2f-886e-a511.ipv6dyn.netcologne.de [IPv6:2001:4dd7:5f0c:0:ebfe:ef2f:886e:a511]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cc-smtpin2.netcologne.de (Postfix) with ESMTPSA; Mon, 1 Feb 2021 08:42:19 +0100 (CET) Subject: Re: A question about coarrays and -Warray-temporaries To: Jorge D'Elia , Gfortran List References: <121178681.597.1612108263047.JavaMail.zimbra@intec.unl.edu.ar> From: Thomas Koenig Message-ID: <9d298701-38a5-c2c5-1daf-7a2dad754369@netcologne.de> Date: Mon, 1 Feb 2021 08:42:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <121178681.597.1612108263047.JavaMail.zimbra@intec.unl.edu.ar> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 01 Feb 2021 07:42:28 -0000 Hi Jorge, > I have a question with -Warray-temporaries in the test below. > > With the AA coarray that warning appears in the first loop (on its local part), > but not with the BB array with the same task, i.e. > > > $ gfortran --version > GNU Fortran (GCC) 11.0.0 20210125 (experimental) > Copyright (C) 2021 Free Software Foundation, Inc. > > $ gfortran -march=native -mtune=native -Ofast -fcheck=all -fcoarray=single -std=f2018 -Wall -Wextra -Warray-temporaries -o test.exe test.f90 > test.f90:37:19: > > 37 | AA (k1:nn,j) = AA (k1:nn,j) - UU (k1:nn) * AA (k,j) > | 1 > Warning: Creating array temporary at (1) [-Warray-temporaries] > > > Why this difference in behavior? Is it ok? It seems that dependency checking does not detect that no overlap can exist in that case, and so generates a temporary. Probably, dependency checking was not updated when coarrays were introduced. This is a missed optimization, not a correctness issue. Best regards Thomas