[Bug c/107370] New: long double precision is wrong in ARM 64

jacob at jacob dot remcomp.fr gcc-bugzilla@gcc.gnu.org
Mon Oct 24 06:11:58 GMT 2022


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.


More information about the Gcc-bugs mailing list