From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sourceware.org (Postfix) with ESMTPS id 86FDE384A018 for ; Wed, 16 Dec 2020 06:36:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 86FDE384A018 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Paul.Zimmermann@inria.fr X-IronPort-AV: E=Sophos;i="5.78,423,1599516000"; d="scan'208";a="367781531" Received: from tomate.loria.fr (HELO tomate) ([152.81.10.51]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Dec 2020 07:36:48 +0100 Date: Wed, 16 Dec 2020 07:36:48 +0100 Message-Id: From: Paul Zimmermann To: Jeff Johnston Cc: newlib@sourceware.org In-Reply-To: (message from Jeff Johnston on Tue, 15 Dec 2020 12:11:25 -0500) Subject: Re: regression in tgamma? References: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_MSPIKE_H3, 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: Wed, 16 Dec 2020 06:36:51 -0000 Hi Jeff, thank you for your answer. Here are the steps I followed to compile Newlib (thanks Alexei Sibidanov): # from newlib-3.3.0 or newlib-4.0.0 mkdir build cd build ../configure --prefix=`pwd` --target=x86_64 # perform the following in $HOME/bin ln -sf `which ar` x86_64-ar ln -sf `which as` x86_64-as ln -sf `which cc` x86_64-cc ln -sf `which gcc` x86_64-gcc ln -sf `which c++` x86_64-c++ ln -sf `which ld` x86_64-ld ln -sf `which nm` x86_64-nm ln -sf `which objdump` x86_64-objdump ln -sf `which objcopy` x86_64-objcopy ln -sf `which ranlib` x86_64-ranlib ln -sf `which readelf` x86_64-readelf ln -sf `which strip` x86_64-strip make # it will fail but it is ok cd x86_64/newlib/libm make # fails too cd tmp ar cr libm.a *.o If you have access to the GCC Compile Farm [1], you can reproduce on gcc67: $ cd /home/zimmerma $ gcc -DNEWLIB -no-pie test3.c newlib-3.3.0/build/x86_64/newlib/libm/tmp/libm.a $ ./a.out x=-0x1.53f198fe3b278p+7 y=0x1.fd6d312572d9cp-1015 $ gcc -DNEWLIB -no-pie test3.c newlib-4.0.0/build/x86_64/newlib/libm/tmp/libm.a $ ./a.out x=-0x1.53f198fe3b278p+7 y=0x1p+0 If you have a simpler way to compile Newlib, please tell me. Best regards, Paul [1] https://gcc.gnu.org/wiki/CompileFarm#List_of_machines > From: Jeff Johnston > Date: Tue, 15 Dec 2020 12:11:25 -0500 > > Hi Paul, > > I copied the newlib/libm/common directory and header files from master to a > separate directory and called __ieee754_tgamma directly in your test (adding > a declaration of __ieee754_tgamma as well). I then built as follows: > > gcc -g -O0 -I. -DNEWLIB testtgamma.c e_tgamma.c e_exp.c k_sin.c math_err.c > er_lgamma.c k_cos.c s_floor.c e_log.c w_log.c > > I get the same result as you get for 3.3.0. > > Can you possibly recheck to see if your 4.0.0 library has been built > correctly? Perhaps I have somehow by-passed the cause of the problem by > compiling directly. > > -- Jeff J. > > On Tue, Dec 15, 2020 at 8:36 AM Paul Zimmermann > wrote: > > Hi, > > while updating my comparison from Newlib 3.3.0 to Newlib 4.0.0, I found > a > regression in tgamma on x86_64/Linux: > > $ cat test3.c > #include > #include > > #ifdef NEWLIB > int errno; > int* __errno () { return &errno; } > #endif > > int main() > { > double x = -0x1.53f198fe3b278p+7, y; > y = tgamma (x); > printf ("x=%a y=%a\n", x, y); > } > > Newlib 3.3.0: > $ gcc -DNEWLIB -no-pie test3.c /localdisk/zimmerma/newlib-3.3.0/libm.a; > ./a.out > x=-0x1.53f198fe3b278p+7 y=0x1.fd6d312572d9cp-1015 > > Newlib 4.0.0: > $ gcc -DNEWLIB -no-pie test3.c /localdisk/zimmerma/newlib-4.0.0/libm.a; > ./a.out > x=-0x1.53f198fe3b278p+7 y=0x1p+0 > > Please can someone confirm? > > Best regards, > Paul