public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jacob at jacob dot remcomp.fr" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107370] New: long double precision is wrong in ARM 64 Date: Mon, 24 Oct 2022 06:11:58 +0000 [thread overview] Message-ID: <bug-107370-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107370 Bug ID: 107370 Summary: long double precision is wrong in ARM 64 Product: gcc Version: 10.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: jacob at jacob dot remcomp.fr Target Milestone: --- This program #include <stdio.h> #include <math.h> int main(void) { printf("%.20Lg \n",sqrtl(2.0L)); } produces the output: 1.4142135623730951455 The four last digits are WRONG. Correct output is: 1.414213562373095048801688724209698 The long double precision is identical to double precision. It should be approx 30 digits but it is only 16. gcc -v MACHINE ARM 64 (raspberry pi) Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/10/lto-wrapper Target: aarch64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 10.2.1-6' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.2.1 20210110 (Debian 10.2.1-6) uname -a Linux raspi 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 GNU/Linux Thanks in advance for your attention.
next reply other threads:[~2022-10-24 6:11 UTC|newest] Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-10-24 6:11 jacob at jacob dot remcomp.fr [this message] 2022-10-24 6:22 ` [Bug c/107370] " jacob at jacob dot remcomp.fr 2022-10-24 15:19 ` [Bug target/107370] " pinskia at gcc dot gnu.org 2022-10-24 18:33 ` jacob at jacob dot remcomp.fr 2022-10-24 18:40 ` [Bug middle-end/107370] long double sqrtl constant folding is wrong pinskia at gcc dot gnu.org 2022-10-24 19:27 ` jakub at gcc dot gnu.org 2022-10-24 19:53 ` jacob at jacob dot remcomp.fr 2022-10-24 19:56 ` jacob at jacob dot remcomp.fr 2022-10-24 20:00 ` joseph at codesourcery dot com 2022-10-24 20:01 ` jacob at jacob dot remcomp.fr 2022-10-24 20:08 ` jacob at jacob dot remcomp.fr 2022-10-24 20:09 ` jacob at jacob dot remcomp.fr 2022-10-24 20:21 ` jakub at gcc dot gnu.org 2022-10-24 20:25 ` jakub at gcc dot gnu.org 2022-10-24 20:32 ` jakub at gcc dot gnu.org 2022-10-24 20:50 ` jacob at jacob dot remcomp.fr 2022-10-24 20:51 ` jacob at jacob dot remcomp.fr 2022-10-24 20:56 ` jacob at jacob dot remcomp.fr 2022-10-24 20:59 ` jacob at jacob dot remcomp.fr 2022-10-24 21:01 ` jacob at jacob dot remcomp.fr 2022-10-24 21:02 ` jakub at gcc dot gnu.org 2022-10-24 21:03 ` jacob at jacob dot remcomp.fr 2022-10-24 21:06 ` jacob at jacob dot remcomp.fr 2022-10-24 21:09 ` jakub at gcc dot gnu.org 2022-10-24 21:26 ` jacob at jacob dot remcomp.fr 2022-10-24 21:29 ` pinskia at gcc dot gnu.org 2022-10-24 21:31 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-107370-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).