From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 29F8D384F4A5 for ; Thu, 17 Nov 2022 18:59:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 29F8D384F4A5 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,172,1665475200"; d="scan'208";a="87029236" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 17 Nov 2022 10:59:52 -0800 IronPort-SDR: DuwAfjQAzXiGzHCYTWdssc4giQ+lZI8Z86VbjnQmrJP70HNUQYL0inIBtHE6afZf9ijBB7Ddk1 u/KerJsc+T90W1VufZjRPh2zGSqbuceRMLFQtpSNyQ/oyBplH5RdsGANrvzrGf0+wDjpDOEZMK 2deeiKfd5PtuUFeJW48xpTk2m/xyV+CF4QOm8up9bzeN5MvQSN27BRJ/qrveFLq5CzOiszOw+c P7iTpWKN1vdSXHtx6SidncNOTIfz2E1aCXkSEUErBM6q2ocVFpUmWerZ5pcduZ2YunU8Czwfhh s1k= Date: Thu, 17 Nov 2022 18:59:45 +0000 From: Joseph Myers To: Aldy Hernandez CC: Jakub Jelinek , GCC patches , Andrew MacLeod Subject: Re: [PATCH] [range-ops] Implement sqrt. In-Reply-To: Message-ID: <4441fc8a-e9e1-6fdd-20d1-473d10122426@codesourcery.com> References: <20221113200553.440728-1-aldyh@redhat.com> <6150f7fd-5a57-c138-f65e-8dc3bf13d11a@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3109.9 required=5.0 tests=BAYES_00,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_PASS,SPF_PASS,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 Thu, 17 Nov 2022, Aldy Hernandez via Gcc-patches wrote: > So... is the optimization wrong? Are we not allowed to substitute > that NAN if we know it's gonna happen? Should we also allow F F F F F > in the test? Or something else? This seems like the usual ambiguity about what transformations -ftrapping-math (on by default) is meant to prevent. Generally it's understood to prevent transformations that add *or remove* exceptions, so folding a case that raises "invalid" to a NaN (with "invalid" no longer raised) is invalid with -ftrapping-math. But that doesn't tend to be applied if the operation raising the exceptions has a result that is otherwise unused - in such a case the operation may still be removed completely (the exception isn't properly treated as a side effect to avoid dead code elimination; cf. Marc Glisse's -ffenv-access patches from August 2020). And it may often also not be applied to "inexact". There have been various past discussions of possible ways to split up the different effects of options such as -ftrapping-math into finer-grained options allowing more control of what transformations are permitted - see e.g. and bug 54192. There is also the question in that context of which sub-options should be enabled by default at all. -- Joseph S. Myers joseph@codesourcery.com