public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tobias Burnus <burnus@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-8445] Testsuite/Fortran: gfortran.dg/pr96711.f90 - fix expected value for PowerPC [PR96983]
Date: Thu, 20 May 2021 08:06:47 +0000 (GMT)	[thread overview]
Message-ID: <20210520080647.8840C385781D@sourceware.org> (raw)

https://gcc.gnu.org/g:271fc1caac433e84e6389e73a5bf07350ea545e2

commit r11-8445-g271fc1caac433e84e6389e73a5bf07350ea545e2
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Thu May 20 09:51:10 2021 +0200

    Testsuite/Fortran: gfortran.dg/pr96711.f90 - fix expected value for PowerPC [PR96983]
    
    gcc/testsuite/ChangeLog:
    
            PR fortran/96983
            * gfortran.dg/pr96711.f90: Use 2**digit(x) instead of a hard-coded value;
            add comments regarding what the code does.
    
    (cherry picked from commit 9e0a5e3ea37f9d7d2b6f2dab7c0bfbeaf08466a3)

Diff:
---
 gcc/testsuite/gfortran.dg/pr96711.f90 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gfortran.dg/pr96711.f90 b/gcc/testsuite/gfortran.dg/pr96711.f90
index 3761a8ea416..3fa5d99cbf2 100644
--- a/gcc/testsuite/gfortran.dg/pr96711.f90
+++ b/gcc/testsuite/gfortran.dg/pr96711.f90
@@ -10,10 +10,12 @@ program p
   implicit none
   real(8)                :: x
   real(16)               :: y
+  ! Assume radix(x) == 2
+  ! 2/epsilon(x) = 2/(radix(x)**(1-digits(x)) = 2**digits(x) with that assumption
   integer(16), parameter :: k1 = nint (2 / epsilon (x), kind(k1))
   integer(16), parameter :: k2 = nint (2 / epsilon (y), kind(k2))
-  integer(16), parameter :: m1 = 9007199254740992_16                    !2**53
-  integer(16), parameter :: m2 = 10384593717069655257060992658440192_16 !2**113
+  integer(16), parameter :: m1 = 2_16**digits(x) ! IEEE: 2**53
+  integer(16), parameter :: m2 = 2_16**digits(y) ! IEEE: 2**113
   integer(16), volatile  :: m
   x = 2 / epsilon (x)
   y = 2 / epsilon (y)


                 reply	other threads:[~2021-05-20  8:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210520080647.8840C385781D@sourceware.org \
    --to=burnus@gcc.gnu.org \
    --cc=gcc-cvs@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).