From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by sourceware.org (Postfix) with ESMTPS id 8A71A385843B; Mon, 29 Jan 2024 17:25:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A71A385843B Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8A71A385843B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.227.17.20 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706549152; cv=none; b=Q2ZvNZEsPC5JeClp1RKdeFVA9vDvXOrJsrdO5UdJDCxsH+WKYyG4FoVfpRGeIzCWqKLTVIyHc55QUsOjzdroukpaIBIYnOEnJqrF6OIC9pAmvxlfYqmJHYp0Uf5ZZPyzK/a4Y2xx1dghwoU5aaZYGfzbLmdee8r+pr8i7SP5Y1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706549152; c=relaxed/simple; bh=sSk+pPOweLRH8Byzm2xy9AAzSP5jcetBlCzTgkA+0tI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=kXnuKC1fBkGTjoSE4Uj1/2WK2/36FU3cga1FgdYG9QUTjlV2W3712j+cTS42gku6YJ9RCb2yMfrPHsfD5Dhks4fvOgbyH8DyJlnABFHhOTZq6DHLPAxKENeEaPjLEsjAM4JGFrDmeHqXdRVADe5mJvjsSM6R357erLzuo0YMlS4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1706549143; x=1707153943; i=anlauf@gmx.de; bh=sSk+pPOweLRH8Byzm2xy9AAzSP5jcetBlCzTgkA+0tI=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=Top4tQWE3yA6mxRm84HrkywWa6KpM7wmnQHvcn5RYvIofLXzkMlrnmnsqI4lAlwo oIRaq6fA8UEkLbF9w1KM8pYohL5t11Fzuh8aJibvirQ89P/cyLnW4ZiInzEAckn0B 6kIgejdocqeu2QNSqdkfIGr/xIGkinMk3qE0eAIlHHcYXeBiZ2OJ3yAEYCulvVzvR B1RNFswj0Q+6NAh2q1L79SX07eMFAIDRh0IMMicuscTJEz84q4MprOcFkcLgmkJ23 9KSRYM2LBKlbpSuBTsYGehKu98T8DGXvOtUdDnBY4ueWC2q+EMb8khTpoxP3MqyEG RRkCnSu3+Eutk0znEQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.178.29] ([79.232.151.157]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N5G9t-1r2YS343GP-011Bg9; Mon, 29 Jan 2024 18:25:43 +0100 Message-ID: <70fc4304-74b4-4d8c-8172-9c3286bc9ada@gmx.de> Date: Mon, 29 Jan 2024 18:25:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fortran: use name of array component in runtime error message [PR30802] To: sgk@troutmask.apl.washington.edu Cc: Mikael Morin , fortran , gcc-patches Newsgroups: gmane.comp.gcc.patches,gmane.comp.gcc.fortran References: <67c77b44-79cb-4029-b59a-c92dfad15fa9@orange.fr> <86888cc5-3650-4044-b67d-89aab1631753@gmx.de> Content-Language: en-US From: Harald Anlauf In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:YUFBmOsNqqEQeezEQzCII0QpBr8M9YYY263gS/hSdaE0xIPWtuY k/3jK7ydnQ8enidzOJAivC8ewmd3sFm9rayj0JCl1dT5FzNGG6EedaFN6QUfhx9tnDSAE+n xx5LPydzSkuajet/v6dU5YCeDgrNPjbxyF/lh2B7a6FEMrp9EKWH3Hzk1HHNu570VbcNEo0 U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: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Am 28.01.24 um 22:43 schrieb Steve Kargl: > On Sun, Jan 28, 2024 at 08:56:24PM +0100, Harald Anlauf wrote: >> >> Am 28.01.24 um 12:39 schrieb Mikael Morin: >>> Le 24/01/2024 =C3=A0 22:39, Harald Anlauf a =C3=A9crit=C2=A0: >>>> Dear all, >>>> >>>> this patch is actually only a followup fix to generate the proper nam= e >>>> of an array reference in derived-type components for the runtime erro= r >>>> message generated for the bounds-checking code.=C2=A0 Without the pro= per >>>> part ref, not only a user may get confused: I was, too... >>>> >>>> The testcase is compile-only, as it is only important to check the >>>> strings used in the error messages. >>>> >>>> Regtested on x86_64-pc-linux-gnu.=C2=A0 OK for mainline? >>>> >>> >>> the change proper looks good, and is an improvement.=C2=A0 But I'm a l= ittle >>> concerned by the production of references like in the test x1%vv%z whi= ch >>> could be confusing and is strictly speaking invalid fortran (multiple >>> non-scalar components).=C2=A0 Did you consider generating x1%vv(?,?)%z= z or >>> x1%vv(...)%z or similar? >> >> yes, that seems very reasonable, given that this is what NAG does. >> >> We also have spurious %_data in some error messages that I'll try >> to get rid off. >> > > I haven't looked at the patch, but sometimes (if not always) things > like _data are marked with attr.artificial. You might see if this > will help with suppressing spurious messages. I was talking about the generated format strings of runtime error messages. program p implicit none type t real :: zzz(10) =3D 42 end type t class(t), allocatable :: xx(:) integer :: j j =3D 0 allocate (t :: xx(1)) print *, xx(1)% zzz(j) end This is generating the following error at runtime since at least gcc-7: Fortran runtime error: Index '0' of dimension 1 of array 'xx%_data%zzz' below lower bound of 1 I believe you were recalling bogus warnings at compile time. There are no warnings here, and there shouldn't.