From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::4]) by sourceware.org (Postfix) with ESMTP id 541C6384B806 for ; Sat, 12 Jun 2021 22:31:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 541C6384B806 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk Received: by angie.orcam.me.uk (Postfix, from userid 500) id 245E092009C; Sun, 13 Jun 2021 00:31:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 1567692009B; Sun, 13 Jun 2021 00:31:32 +0200 (CEST) Date: Sun, 13 Jun 2021 00:31:32 +0200 (CEST) From: "Maciej W. Rozycki" To: Jeff Johnston cc: Paul Zimmermann , Newlib Subject: Re: incorrectly rounded square root In-Reply-To: Message-ID: References: <2f8796f4-f164-5734-16ca-9a392e788beb@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-3488.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2021 22:31:35 -0000 On Fri, 4 Jun 2021, Jeff Johnston wrote: > The compiler is optimizing out the rounding check in ef_sqrt.c, probably > due to the operation using two constants. Have you checked the `-frounding-math' option to GCC? This piece of code (as probably all newlib's math pieces) ought to be built with that option, and if that still does not help (which it may well, as noted in the GCC manual), then would you please file a bug with GCC, attaching the test case discussed here as a reproducer? FWIW glibc does use said option, which may be why seemingly equivalent code works with glibc but not with newlib. HTH, Maciej