public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pthaugen at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/67531] FAIL: gfortran.dg/ieee/large_2.f90   -O0  execution test
Date: Thu, 10 Sep 2015 21:31:00 -0000	[thread overview]
Message-ID: <bug-67531-4-gSFgcNdu7K@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-67531-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Pat Haugen <pthaugen at gcc dot gnu.org> ---
(In reply to Francois-Xavier Coudert from comment #1)
> Thanks for the report. So apparently, on powerpc64le-unknown-linux-gnu, long
> double division of 1.0L by 3.0L with rounding mode set to "down" is
> incorrect.
> 
> Can you compile and run the following C test case?
> 
> $ cat z.c 
> #include <fenv.h>
> #include <stdio.h>
> 
> int main (void)
> {
>   long double x1, x2, x;
> 
>   fesetround (FE_UPWARD);
>   x1 = 1;
>   x = 3;
>   x1 = x1 / x;
> 
>   fesetround (FE_DOWNWARD);
>   x2 = 1;
>   x = 3;
>   x2 = x2 / x;
> 
>   printf ("%.40Lg\n", x1);
>   printf ("%.40Lg\n", x2);
> }
> $ gcc z.c -lm && ./a.out 
> 0.3333333333333333333423683514373792036167
> 0.3333333333333333333152632971252415927665
> 
> 
> Above is the result on x86_64-linux, so the outcome shouldn't be identical,
> but the two numbers output should not be equal.

pthaugen@genoa:~$ ~/install/gcc/trunk/bin/gcc z.c -lm && ./a.out
0.3333333333333333333333333333333353876586
0.3333333333333333333333333333333292246827


  reply	other threads:[~2015-09-10 21:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 22:09 [Bug fortran/67531] New: " pthaugen at gcc dot gnu.org
2015-09-10 21:31 ` pthaugen at gcc dot gnu.org [this message]
2015-09-10 21:45 ` [Bug fortran/67531] " fxcoudert at gcc dot gnu.org
2015-09-10 22:00 ` schwab@linux-m68k.org
2015-09-11 13:50 ` [Bug fortran/67531] No IEEE rounding support for powerpc long double type pthaugen at gcc dot gnu.org
2021-05-04 12:31 ` rguenth 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-67531-4-gSFgcNdu7K@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).