public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107370] New: long double precision is wrong in ARM 64
@ 2022-10-24  6:11 jacob at jacob dot remcomp.fr
  2022-10-24  6:22 ` [Bug c/107370] " jacob at jacob dot remcomp.fr
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: jacob at jacob dot remcomp.fr @ 2022-10-24  6:11 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2022-10-24 21:31 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24  6:11 [Bug c/107370] New: long double precision is wrong in ARM 64 jacob at jacob dot remcomp.fr
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

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).