From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moene.org (84-86-97-173.fixed.kpn.net [84.86.97.173]) by sourceware.org (Postfix) with ESMTPS id 1B5903858D3C for ; Tue, 21 Mar 2023 18:55:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B5903858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=moene.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=moene.org Received: from localhost ([127.0.0.1]) by moene.org with esmtp (Exim 4.96) (envelope-from ) id 1peh8O-0008CR-1l for gcc-patches@gcc.gnu.org; Tue, 21 Mar 2023 19:55:00 +0100 Message-ID: <2c85d96e-f3d8-ae29-d26c-c49821e2417a@moene.org> Date: Tue, 21 Mar 2023 19:55:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: Should -ffp-contract=off the default on GCC? To: gcc-patches@gcc.gnu.org References: <6659A77B-DA2F-40A6-BDBD-E8B29B9E901D@oracle.com> <87384938-FDB1-487B-8B03-7787996435B2@comcast.net> <7C6B7ED7-7AA4-47EF-8E44-E3AD81BF3E29@oracle.com> <4a670847-9728-e0cb-46f3-d476839f7cd4@gmail.com> <07C4F156-7482-45F2-9388-67FF2C67A3BB@comcast.net> Content-Language: en-US From: Toon Moene Organization: Moene Computational Physics, Maartensdijk, The Netherlands In-Reply-To: <07C4F156-7482-45F2-9388-67FF2C67A3BB@comcast.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KHOP_HELO_FCRDNS,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 3/21/23 19:03, Paul Koning via Gcc-patches wrote: >> Failure to understand the language is a common problem and we do try to emit various diagnostics to help developers avoid writing non-conformant code. But ultimately if a developer fails to understand the language standard, then they're going to be surprised by the behavior of their code. > > Conversely, of course, the problem is that C and other languages have evolved to the point that you have to be a language lawyer to write valid code. In other words, a substantial fraction of programmers are by definition writing unreliable code. This is not a good situation, and it may be part of the reason why modern software has such a high rate of defects. Fortran compilers that I use regularly (I mean, aside from gfortran) have already given up on this battle, at least as far as floating point issues are concerned. So many people want to have "repeatable floating point computations" that if someone writes: READ*, X, Y, Z PRINT*, X + Y + Z END they will get (if they know the compiler option that guarantees this - but they will) the following code: READ*, X, Y, Z PRINT*, (X + Y) + Z END even though there's no way in hell the Fortran Language Standard (any of them) guarantees this. -- Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands