From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by sourceware.org (Postfix) with ESMTPS id D44383858D28; Thu, 16 Dec 2021 16:43:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D44383858D28 X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from gluon.fritz.box ([79.251.5.144]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M3DJv-1mwVsT2P77-003ckk; Thu, 16 Dec 2021 17:43:28 +0100 Subject: Re: [patch] Fix libfortran/98507, handling of timezone near year boundaries To: FX , fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Newsgroups: gmane.comp.gcc.fortran,gmane.comp.gcc.patches References: From: Harald Anlauf Message-ID: <1c874642-e97a-fab8-088d-6d23c715d1be@gmx.de> Date: Thu, 16 Dec 2021 17:43:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:IU18ciaE/f5YMYE8wc31itzEIPtUdoG1Gk3gxc0b96vXhZQnQ9N hVZQsR2Aa/t2BkVKvw+f3rWws633TGVmvuOWzWvsHEVAho1v8oOuL7GQUX/dNoHb/MhJ9RS 35wtsxdQWA2DPcjFt7oIwtb0LbBMWojW4MAJLEfUTkH3omcoLP7ct2FP3j4g1DS7bZleneY u5uuqhHSfoXrWu5AeioPg== X-UI-Out-Filterresults: notjunk:1;V03:K0:X5tWehGD2zo=:Twq4GNvCPWMlBYf552+83T XE6+vSv1DOAj0XfjMik73Kh4yN44MFdTVDl+zsXP1S1yNPv7l7tLUXGh0GlDcxtCkYin3RPx4 hICkpXkz6xXQxufmtWf+whH+32z6bPusj0VBD2C0MzPUDkRFp2VY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VD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Dec 2021 16:43:32 -0000 Hi FX, Am 16.12.21 um 15:17 schrieb FX via Fortran: > Hi, > > DATE_AND_TIME can return incorrect values for non-UTC timezones, near th= e new year, when the local time and UTC time are in different years. https= ://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98507 > > Attached patch fixes the issue by correcting the logic to account for th= at wrapping of =E2=80=9Cday of the year=E2=80=9D around new year. I includ= e a testcase, which checks the sanity of values returned by DATE_AND_TIME.= Since the bug only occurs for a few hours every year, and depends on loca= l timezone, I could not think of a better (systematic) test. please change "call abort" to "stop n". The former should no longer be used in the testsuite. > I also want to propose (it=E2=80=99s not directly needed to fix the bug)= that we switch our time routines to rely on clock_gettime() instead of ge= ttimeofday(), when available. This is in line with POSIX.1-2008, which mar= ks gettimeofday() as obsolete, recommending the use of > clock_gettime() instead. Agreed. > Bootstrapped and regtested on x86_64-pc-linux-gnu. > OK to commit? > > FX > > OK after fixing the above, and thanks for the patch! Harald