From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by sourceware.org (Postfix) with ESMTPS id 778383858407 for ; Wed, 22 Nov 2023 09:36:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 778383858407 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=orange.fr ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 778383858407 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=80.12.242.26 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700645773; cv=none; b=EcZfbo+/dUQw6GpLEjvBimNmnnRSg5yb1Z8pixv1BfMMMv303clCnzgbkh/f8hJN0DpwhJ5Rsn+E3rXVCL3B+CLMNKZW/fIl0gqMBJXjgXmTiiIHZCsEKPH1FwMMMIrMg2M8P8jZBE4bIvRsT3WE27ql8xfenlXdRnjHf5Mwj+I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700645773; c=relaxed/simple; bh=LjHNDlO1AMgKglHsJhfA4fVMetECG+5v0J3Vq/8ZibI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=PFGEkfGOK70WKtHW3aLOHa2N6djrreatbhv6DgNpkrbbUx+1T1POnnFtA4Tp4feyadoOzzvY4ALb7F5YqXG+jV2iWxBACpxR/YHK5dlX7BA+DGHrWOqEWULbWpkzXLR8lTqmb/pwXstbo+lMD0aA5ZJ5z5NU0PY2Gj0VrlPM5Uc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [192.168.1.13] ([86.215.161.51]) by smtp.orange.fr with ESMTPA id 5jeLrp1cpTzFX5jeRrjtVp; Wed, 22 Nov 2023 10:36:10 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=orange.fr; s=t20230301; t=1700645770; bh=yOUYgOeQws/YkLBVUaFMatGU8ZgEFxuE+c6SQw3RUK4=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=BbBsE6lgj9VWX0k97jptkzT92K8/n5MW2WFulh8Yvb1KnUysV0piXpBSRbpLCEfgh vxR71BB8SUpV31HZzYju81S7D9AdXKiR+0ENJmjS4lxRidqDAN6Z6XGgm4rveiU0F3 WVdGiZnEj7M+SfnbTQuz6AaUbTDued8VF8/YPmeri0MhE8MiouADWLS1dJ5HAty1+b kbfPbJJF/vWNy/3YhO0NI6Fcc95ZNcGfBl4CdwMoKg++pILPcubYara3dDvw/50DHj SHdwodj/t9tnQG8kRrvPVq/3Irih09QnRFOhFv7Aw2K/ezW4OKyaxIEKxx7frCK7e+ 2sdejM0ErpDaQ== X-ME-Helo: [192.168.1.13] X-ME-Auth: bW9yaW4tbWlrYWVsQG9yYW5nZS5mcg== X-ME-Date: Wed, 22 Nov 2023 10:36:10 +0100 X-ME-IP: 86.215.161.51 Message-ID: <97809d56-b3dc-42c9-85e8-6eb8bc618428@orange.fr> Date: Wed, 22 Nov 2023 10:36:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH, v3] Fortran: restrictions on integer arguments to SYSTEM_CLOCK [PR112609] To: Harald Anlauf , sgk@troutmask.apl.washington.edu Cc: fortran , gcc-patches References: <2898e351-eee8-45dd-a05d-0280378ba872@gmx.de> <84f48fee-a5b8-4bef-aa9b-f176d3cfbfa6@orange.fr> <06b5440b-fdab-4c02-988a-ea849aadfd48@gmx.de> Content-Language: en-US From: Mikael Morin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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: Le 21/11/2023 à 23:09, Harald Anlauf a écrit : > Uhh, it happened again.  Attached a wrong patch. > Only looked at the -v3 ...  My bad. > > Sorry! > > Harald > > > On 11/21/23 22:54, Harald Anlauf wrote: >> Hi Mikael, Steve, >> >> On 11/21/23 12:33, Mikael Morin wrote: >>> Harald, you mentioned the lack of GFC_STD_F2023_DEL feature group in >>> your first message, but I don't quite understand why you didn't add one. >>>   It seems to me the most natural way to do this. >> >> thanks for insisting on this variant. >> >> In my first attack at this problem, I overlooked one place in >> libgfortran.h, which I now was able to find and adjust. >> Now everything falls into place. >> >>> I suggest we emit a warning by default, error with -std=f2023 (I agree >>> with Steve that we should push towards strict f2023 conformance), and no >>> diagnostic with -std=gnu or -std=f2018 or lower. >> >> As the majority agrees on this, I accept it.  The attached patch >> now does this and fixes the testcases accordingly. >> >>>> It seems that the solution is to fix the code in the testsuite. >>> >>> Agreed, these seem to explicitly test mismatching kinds, so add an >>> option to prevent error. >> >> Done. >> >> I also fixed a few issues in the documentation in gfortran.texi . >> >> As I currently cannot build a full compiler (see PR112643), >> patch V3 is not properly regtested yet, but appears to give >> results as discussed. >> >> Comments? >> >>> Mikael >> >> Thanks, >> Harald >> >> > (...) > diff --git a/gcc/fortran/error.cc b/gcc/fortran/error.cc > index 2ac51e95e4d..be715b50469 100644 > --- a/gcc/fortran/error.cc > +++ b/gcc/fortran/error.cc > @@ -980,7 +980,11 @@ char const* > notify_std_msg(int std) > { > > - if (std & GFC_STD_F2018_DEL) > + if (std & GFC_STD_F2023_DEL) > + return _("Fortran 2023 deleted feature:"); As there are officially no deleted feature in f2023, maybe use a slightly different wording? Say "Not allowed in fortran 2023" or "forbidden in Fortran 2023" or similar? > + else if (std & GFC_STD_F2023) > + return _("Fortran 2023:"); > + else if (std & GFC_STD_F2018_DEL) > return _("Fortran 2018 deleted feature:"); > else if (std & GFC_STD_F2018_OBS) > return _("Fortran 2018 obsolescent feature:"); > diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h > index bdddb317ab0..af7a170c2b1 100644 > --- a/gcc/fortran/libgfortran.h > +++ b/gcc/fortran/libgfortran.h > @@ -19,9 +19,10 @@ along with GCC; see the file COPYING3. If not see > > > /* Flags to specify which standard/extension contains a feature. > - Note that no features were obsoleted nor deleted in F2003 nor in F2023. > + Note that no features were obsoleted nor deleted in F2003. I think we can add a comment that F2023 has no deleted feature, but some more stringent restrictions in f2023 forbid some previously valid code. > Please remember to keep those definitions in sync with > gfortran.texi. */ > +#define GFC_STD_F2023_DEL (1<<13) /* Deleted in F2023. */ > #define GFC_STD_F2023 (1<<12) /* New in F2023. */ > #define GFC_STD_F2018_DEL (1<<11) /* Deleted in F2018. */ > #define GFC_STD_F2018_OBS (1<<10) /* Obsolescent in F2018. */ > @@ -41,12 +42,13 @@ along with GCC; see the file COPYING3. If not see > * are allowed with a certain -std option. */ > #define GFC_STD_OPT_F95 (GFC_STD_F77 | GFC_STD_F95 | GFC_STD_F95_OBS \ > | GFC_STD_F2008_OBS | GFC_STD_F2018_OBS \ > - | GFC_STD_F2018_DEL) > + | GFC_STD_F2018_DEL | GFC_STD_F2023_DEL) > #define GFC_STD_OPT_F03 (GFC_STD_OPT_F95 | GFC_STD_F2003) > #define GFC_STD_OPT_F08 (GFC_STD_OPT_F03 | GFC_STD_F2008) > #define GFC_STD_OPT_F18 ((GFC_STD_OPT_F08 | GFC_STD_F2018) \ > & (~GFC_STD_F2018_DEL)) F03, F08 and F18 should have GFC_STD_F2023_DEL (and also F03 and F08 should have GFC_STD_F2018_DEL). OK with this fixed (and the previous comments as you wish), if Steve has no more comments. Thanks for the patch.