public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8445] Testsuite/Fortran: gfortran.dg/pr96711.f90 - fix expected value for PowerPC [PR96983]
@ 2021-05-20  8:06 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2021-05-20  8:06 UTC (permalink / raw)
  To: gcc-cvs

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-20  8:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-20  8:06 [gcc r11-8445] Testsuite/Fortran: gfortran.dg/pr96711.f90 - fix expected value for PowerPC [PR96983] Tobias Burnus

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