public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/97653] Incorrect long double calculation with -mabi=ibmlongdouble
Date: Tue, 23 Mar 2021 18:08:35 +0000	[thread overview]
Message-ID: <bug-97653-4-WVqtXgAZZi@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97653-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97653

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
[test@ibm-p8-cluster-02 ~]$ cat 97653.c
int printf(const char*, ...);

const unsigned long k = 256;

int main()
{
  long double r[] = { 0.1L, 0.2L, 0.5L, 0.9L };
  for (int i = 0; i < 4; ++i)
  {
    unsigned long j = k * r[i];
    printf("%lu * %Lf = %lu\n", k, r[i], j);
  }
}
[test@ibm-p8-cluster-02 ~]$ ~/gcc/ieee/bin/gcc 97653.c  -mno-gnu-attribute
-mabi=ibmlongdouble  -Wall -static-libgcc -v  && ./a.out
Using built-in specs.
COLLECT_GCC=/home/test/gcc/ieee/bin/gcc
COLLECT_LTO_WRAPPER=/home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown-linux-gnu/11.0.1/lto-wrapper
Target: powerpc64le-unknown-linux-gnu
Configured with: /home/test/src/gcc/configure --prefix=/home/test/gcc/ieee
--disable-multilib --disable-bootstrap --enable-languages=c++ --disable-pch
--disable-nls --without-isl --with-long-double-format=ieee : (reconfigured)
/home/test/src/gcc/configure --prefix=/home/test/gcc/ieee --disable-multilib
--disable-bootstrap --enable-languages=c++ --disable-pch --disable-nls
--without-isl --with-long-double-format=ieee
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.1 20210323 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-mno-gnu-attribute' '-mabi=ibmlongdouble' '-Wall'
'-static-libgcc' '-v' '-dumpdir' 'a-'
 /home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown-linux-gnu/11.0.1/cc1
-quiet -v 97653.c -quiet -dumpdir a- -dumpbase 97653.c -dumpbase-ext .c
-mno-gnu-attribute -mabi=ibmlongdouble -Wall -version -o /tmp/ccNHNZzj.s
GNU C17 (GCC) version 11.0.1 20210323 (experimental)
(powerpc64le-unknown-linux-gnu)
        compiled by GNU C version 11.0.0 20210225 (Red Hat 11.0.0-0), GMP
version 6.2.0, MPFR version 4.1.0-p9, MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory
"/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/../../../../powerpc64le-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/include
 /usr/local/include
 /home/test/gcc/ieee/include
 /home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/include-fixed
 /usr/include
End of search list.
GNU C17 (GCC) version 11.0.1 20210323 (experimental)
(powerpc64le-unknown-linux-gnu)
        compiled by GNU C version 11.0.0 20210225 (Red Hat 11.0.0-0), GMP
version 6.2.0, MPFR version 4.1.0-p9, MPC version 1.2.1, isl version none
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: ab29af0a0f73449cd280c2751cbad267
COLLECT_GCC_OPTIONS='-mno-gnu-attribute' '-mabi=ibmlongdouble' '-Wall'
'-static-libgcc' '-v' '-dumpdir' 'a-'
 as -v -a64 -mpower8 -mlittle -o /tmp/cc4MmQYf.o /tmp/ccNHNZzj.s
GNU assembler version 2.35.1 (ppc64le-redhat-linux) using BFD version version
2.35.1-41.fc34
COMPILER_PATH=/home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown-linux-gnu/11.0.1/:/home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown-linux-gnu/11.0.1/:/home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown-linux-gnu/:/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/:/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/
LIBRARY_PATH=/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/:/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-mno-gnu-attribute' '-mabi=ibmlongdouble' '-Wall'
'-static-libgcc' '-v' '-dumpdir' 'a.'
 /home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown-linux-gnu/11.0.1/collect2
-plugin
/home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown-linux-gnu/11.0.1/liblto_plugin.so
-plugin-opt=/home/test/gcc/ieee/libexec/gcc/powerpc64le-unknown-linux-gnu/11.0.1/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccwamb6Q.res -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh
--eh-frame-hdr -V -m elf64lppc -dynamic-linker /lib64/ld64.so.2
/lib/../lib64/crt1.o /lib/../lib64/crti.o
/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/crtbegin.o
-L/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1
-L/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/../../..
/tmp/cc4MmQYf.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh
/home/test/gcc/ieee/lib/gcc/powerpc64le-unknown-linux-gnu/11.0.1/crtend.o
/lib/../lib64/crtn.o
GNU ld version 2.35.1-41.fc34
  Supported emulations:
   elf64lppc
   elf32lppc
   elf32lppclinux
   elf32lppcsim
   elf64ppc
   elf32ppc
   elf32ppclinux
   elf32ppcsim
   elf32_spu
   i386pep
   i386pe
   elf64bpf
COLLECT_GCC_OPTIONS='-mno-gnu-attribute' '-mabi=ibmlongdouble' '-Wall'
'-static-libgcc' '-v' '-dumpdir' 'a.'
256 * 0.100000 = 256
256 * 0.200000 = 256
256 * 0.500000 = 256
256 * 0.900000 = 256

  parent reply	other threads:[~2021-03-23 18:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31  8:57 [Bug target/97653] New: " redi at gcc dot gnu.org
2020-10-31  8:58 ` [Bug target/97653] " redi at gcc dot gnu.org
2020-10-31  9:00 ` redi at gcc dot gnu.org
2020-10-31  9:12 ` redi at gcc dot gnu.org
2020-11-03 19:51 ` meissner at gcc dot gnu.org
2020-11-03 19:58 ` meissner at gcc dot gnu.org
2020-11-04 12:02 ` redi at gcc dot gnu.org
2020-12-08 14:09 ` redi at gcc dot gnu.org
2021-01-21  1:41 ` meissner at gcc dot gnu.org
2021-01-21  1:44 ` meissner at gcc dot gnu.org
2021-03-23 18:07 ` redi at gcc dot gnu.org
2021-03-23 18:08 ` redi at gcc dot gnu.org [this message]
2021-03-30 11:28 ` jakub at gcc dot gnu.org
2021-03-30 11:44 ` redi at gcc dot gnu.org
2021-03-30 11:49 ` redi at gcc dot gnu.org
2021-03-30 12:02 ` jakub at gcc dot gnu.org
2021-03-31 10:58 ` [Bug target/97653] [11 Regression] " jakub at gcc dot gnu.org
2021-03-31 11:59 ` jakub at gcc dot gnu.org
2021-03-31 12:24 ` jakub at gcc dot gnu.org
2021-04-03  8:06 ` cvs-commit at gcc dot gnu.org
2021-04-03  8:16 ` jakub at gcc dot gnu.org
2021-04-20  9:45 ` cvs-commit 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-97653-4-WVqtXgAZZi@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: link
Be 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).