From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 93A9D389FC20 for ; Fri, 18 Dec 2020 08:42:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 93A9D389FC20 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-188-8aZFIKbrMbiWKUdT1peZ8A-1; Fri, 18 Dec 2020 03:42:11 -0500 X-MC-Unique: 8aZFIKbrMbiWKUdT1peZ8A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 850A4107ACE6; Fri, 18 Dec 2020 08:42:10 +0000 (UTC) Received: from calimero.vinschen.de (ovpn-115-114.ams2.redhat.com [10.36.115.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F9F760BE5; Fri, 18 Dec 2020 08:42:10 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 9ADFEA80457; Fri, 18 Dec 2020 09:42:08 +0100 (CET) Date: Fri, 18 Dec 2020 09:42:08 +0100 From: Corinna Vinschen To: Paul Zimmermann Cc: newlib@sourceware.org Subject: Re: regression in tgamma? Message-ID: <20201218084208.GN4560@calimero.vinschen.de> Reply-To: newlib@sourceware.org Mail-Followup-To: Paul Zimmermann , newlib@sourceware.org References: <871rfo76mw.fsf@keithp.com> <87v9d05jkl.fsf@keithp.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Fri, 18 Dec 2020 08:42:15 -0000 Paul, could you please send patches in `git format-patch' format? Even with `patch -p1', the below patch doesn't apply cleanly. Thanks, Corinna On Dec 18 07:36, Paul Zimmermann wrote: > Hi Jeff, > > > I have modified er_lgamma.c, erf_lgamma.c, w_tgamma.c, wf_tgamma.c based on > > code changes in picolibc. > > I did not add the new ___ieee754_ sub-functions and instead modified the > > existing code assuming that the function > > was called with *signgam = 0. We can always do a merge from picolibc in the > > future. > > > > With the new code, the test runs as expected. > > > > Paul, please confirm before tomorrow. > > version b2f3d59 fails to compile on my x86_64 machine: > > ../../../../../newlib/libm/math/w_tgamma.c: In function ‘tgamma’: > ../../../../../newlib/libm/math/w_tgamma.c:38:6: error: ‘errno’ undeclared (first use in this function) > 38 | errno = EDOM; > | ^~~~~ > ../../../../../newlib/libm/math/w_tgamma.c:19:1: note: ‘errno’ is defined in header ‘’; did you forget to ‘#include ’? > 18 | #include "fdlibm.h" > +++ |+#include > > ../../../../../newlib/libm/math/w_tgamma.c:38:6: note: each undeclared identifier is reported only once for each function it appears in > 38 | errno = EDOM; > | ^~~~~ > ../../../../../newlib/libm/math/w_tgamma.c:38:14: error: ‘EDOM’ undeclared (first use in this function) > 38 | errno = EDOM; > | ^~~~ > ../../../../../newlib/libm/math/w_tgamma.c:40:14: error: ‘ERANGE’ undeclared (first use in this function) > 40 | errno = ERANGE; > | ^~~~~~ > > It does after the following changes: > > diff --git a/newlib/libm/math/w_tgamma.c b/newlib/libm/math/w_tgamma.c > index 0f90dd4c6..52d5d71d3 100644 > --- a/newlib/libm/math/w_tgamma.c > +++ b/newlib/libm/math/w_tgamma.c > @@ -16,6 +16,7 @@ > */ > > #include "fdlibm.h" > +#include > > #ifndef _DOUBLE_IS_32BITS > > diff --git a/newlib/libm/math/wf_tgamma.c b/newlib/libm/math/wf_tgamma.c > index 80aacf757..504cb4c29 100644 > --- a/newlib/libm/math/wf_tgamma.c > +++ b/newlib/libm/math/wf_tgamma.c > @@ -15,6 +15,7 @@ > > #include "math.h" > #include "fdlibm.h" > +#include > > #ifdef __STDC__ > float tgammaf(float x) > @@ -34,7 +35,6 @@ > errno = EDOM; > else if (finite(x)) > errno = ERANGE; > - } > return y; > #endif > } > > and my small test program gives: > > zimmerma@tomate:/tmp/newlib-cygwin$ ./a.out > x=-0x0p+0 y=-inf > x=-0x1.53f198fe3b278p+7 y=0x1.fd6d312572d9cp-1015 > > which is ok. I'll do some further tests. > > Paul