From 80cf2facbbdafed159b326d83f7cf3999c3df8d0 Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Fri, 5 Mar 2021 10:43:11 +0100 Subject: [PATCH] Fortran: Follow fixes to -freal-{4,8}-real* handling [PR99355,PR57871] gcc/fortran/ChangeLog: PR fortran/99355 PR fortran/57871 * invoke.texi (-freal{4,8}-real-*): Extend description. * primary.c (match_real_constant): Also promote real literals with '_kind' number. gcc/testsuite/ChangeLog: * gfortran.dg/real4-10-real8-10.f90: Add check for real literals with '_kind' number. * gfortran.dg/real4-10-real8-16.f90: Likewise. * gfortran.dg/real4-10-real8-4.f90: Likewise. * gfortran.dg/real4-10.f90: Likewise. * gfortran.dg/real4-16-real8-10.f90: Likewise. * gfortran.dg/real4-16-real8-16.f90: Likewise. * gfortran.dg/real4-16-real8-4.f90: Likewise. * gfortran.dg/real4-16.f90: Likewise. * gfortran.dg/real4-8-real8-10.f90: Likewise. * gfortran.dg/real4-8-real8-16.f90: Likewise. * gfortran.dg/real4-8-real8-4.f90: Likewise. * gfortran.dg/real4-8.f90: Likewise. * gfortran.dg/real8-10.f90: Likewise. * gfortran.dg/real8-16.f90: Likewise. * gfortran.dg/real8-4.f90: Likewise. --- gcc/fortran/invoke.texi | 19 +++++++++++++++---- gcc/fortran/primary.c | 19 +++++++++++++++++++ .../gfortran.dg/real4-10-real8-10.f90 | 6 ++++-- .../gfortran.dg/real4-10-real8-16.f90 | 6 ++++-- .../gfortran.dg/real4-10-real8-4.f90 | 6 ++++-- gcc/testsuite/gfortran.dg/real4-10.f90 | 6 ++++-- .../gfortran.dg/real4-16-real8-10.f90 | 6 ++++-- .../gfortran.dg/real4-16-real8-16.f90 | 6 ++++-- .../gfortran.dg/real4-16-real8-4.f90 | 6 ++++-- gcc/testsuite/gfortran.dg/real4-16.f90 | 6 ++++-- .../gfortran.dg/real4-8-real8-10.f90 | 6 ++++-- .../gfortran.dg/real4-8-real8-16.f90 | 6 ++++-- gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 | 6 ++++-- gcc/testsuite/gfortran.dg/real4-8.f90 | 6 ++++-- gcc/testsuite/gfortran.dg/real8-10.f90 | 6 ++++-- gcc/testsuite/gfortran.dg/real8-16.f90 | 6 ++++-- gcc/testsuite/gfortran.dg/real8-4.f90 | 6 ++++-- 17 files changed, 94 insertions(+), 34 deletions(-) diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 3f3ae5a76116..0fb7e1add7e9 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -520,13 +520,24 @@ representation of the translated Fortran code, produced by @cindex options, real kind type promotion Promote all @code{REAL(KIND=M)} entities to @code{REAL(KIND=N)} entities. If @code{REAL(KIND=N)} is unavailable, then an error will be issued. -All other real kind types are unaffected by this option. +The @code{-freal-4-} flags also affect the default real kind and the +@code{-freal-8-} flags also the double-precision real kind. All other +real-kind types are unaffected by this option. The promotion is also +applied to real literal constants of default and double-precision kind +and a specified kind number of 4 or 8, respectively. +However, @code{-fdefault-real-8}, @code{-fdefault-real-10}, +@code{-fdefault-real-10}, and @code{-fdefault-double-8} take precedence +for the default and double-precision real kinds, both for real literal +constants and for declarations without a kind number. +Note that for @code{REAL(KIND=KIND(1.0))} the literal may get promoted and +then the result may get promoted again. These options should be used with care and may not be suitable for your codes. Areas of possible concern include calls to external procedures, alignment in @code{EQUIVALENCE} and/or @code{COMMON}, generic interfaces, -BOZ literal constant conversion, and I/O. Inspection of the intermediate -representation of the translated Fortran code, produced by -@option{-fdump-tree-original}, is suggested. +BOZ literal constant conversion, and I/O and calls to intrinsic procedures +when passing a value to the @code{kind=} dummy argument. Inspection of the +intermediate representation of the translated Fortran code, produced by +@option{-fdump-fortran-original} or @option{-fdump-tree-original}, is suggested. @item -std=@var{std} @opindex @code{std=}@var{std} option diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 9dd1a86f2750..a6df885c80c9 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -666,6 +666,25 @@ done: if (kind == -1) goto cleanup; + if (kind == 4) + { + if (flag_real4_kind == 8) + kind = 8; + if (flag_real4_kind == 10) + kind = 10; + if (flag_real4_kind == 16) + kind = 16; + } + else if (kind == 8) + { + if (flag_real8_kind == 4) + kind = 4; + if (flag_real8_kind == 10) + kind = 10; + if (flag_real8_kind == 16) + kind = 16; + } + switch (exp_char) { case 'd': diff --git a/gcc/testsuite/gfortran.dg/real4-10-real8-10.f90 b/gcc/testsuite/gfortran.dg/real4-10-real8-10.f90 index af4f1b2b4e62..1afd9ca5dca0 100644 --- a/gcc/testsuite/gfortran.dg/real4-10-real8-10.f90 +++ b/gcc/testsuite/gfortran.dg/real4-10-real8-10.f90 @@ -2,6 +2,7 @@ ! { dg-additional-options "-w -freal-4-real-10 -freal-8-real-10" } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -9,6 +10,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -18,6 +20,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-10-real8-16.f90 b/gcc/testsuite/gfortran.dg/real4-10-real8-16.f90 index 408d3475499a..83c51193889a 100644 --- a/gcc/testsuite/gfortran.dg/real4-10-real8-16.f90 +++ b/gcc/testsuite/gfortran.dg/real4-10-real8-16.f90 @@ -3,6 +3,7 @@ ! { dg-require-effective-target fortran_real_16 } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -10,6 +11,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -19,6 +21,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-10-real8-4.f90 b/gcc/testsuite/gfortran.dg/real4-10-real8-4.f90 index 7e52cdb0ac1c..19b79e9ab6b7 100644 --- a/gcc/testsuite/gfortran.dg/real4-10-real8-4.f90 +++ b/gcc/testsuite/gfortran.dg/real4-10-real8-4.f90 @@ -2,6 +2,7 @@ ! { dg-additional-options "-w -freal-4-real-10 -freal-8-real-4" } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -9,6 +10,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -18,6 +20,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-10.f90 b/gcc/testsuite/gfortran.dg/real4-10.f90 index 44fcd83a002b..133af44373e4 100644 --- a/gcc/testsuite/gfortran.dg/real4-10.f90 +++ b/gcc/testsuite/gfortran.dg/real4-10.f90 @@ -2,6 +2,7 @@ ! { dg-additional-options "-w -freal-4-real-10" } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -9,6 +10,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -18,6 +20,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 10)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-16-real8-10.f90 b/gcc/testsuite/gfortran.dg/real4-16-real8-10.f90 index d080a1004c07..1ddefca36dd0 100644 --- a/gcc/testsuite/gfortran.dg/real4-16-real8-10.f90 +++ b/gcc/testsuite/gfortran.dg/real4-16-real8-10.f90 @@ -3,6 +3,7 @@ ! { dg-require-effective-target fortran_real_16 } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -10,6 +11,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -19,6 +21,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-16-real8-16.f90 b/gcc/testsuite/gfortran.dg/real4-16-real8-16.f90 index d525c6014aa5..0e761933d9e2 100644 --- a/gcc/testsuite/gfortran.dg/real4-16-real8-16.f90 +++ b/gcc/testsuite/gfortran.dg/real4-16-real8-16.f90 @@ -3,6 +3,7 @@ ! { dg-require-effective-target fortran_real_16 } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -10,6 +11,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -19,6 +21,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-16-real8-4.f90 b/gcc/testsuite/gfortran.dg/real4-16-real8-4.f90 index e508819350e3..3d2185b2e26c 100644 --- a/gcc/testsuite/gfortran.dg/real4-16-real8-4.f90 +++ b/gcc/testsuite/gfortran.dg/real4-16-real8-4.f90 @@ -3,6 +3,7 @@ ! { dg-require-effective-target fortran_real_16 } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -10,6 +11,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -19,6 +21,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-16.f90 b/gcc/testsuite/gfortran.dg/real4-16.f90 index 5cd2f1f4822e..e07bcd4b23ef 100644 --- a/gcc/testsuite/gfortran.dg/real4-16.f90 +++ b/gcc/testsuite/gfortran.dg/real4-16.f90 @@ -3,6 +3,7 @@ ! { dg-require-effective-target fortran_real_16 } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -10,6 +11,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -19,6 +21,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 16)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-8-real8-10.f90 b/gcc/testsuite/gfortran.dg/real4-8-real8-10.f90 index 742d35248271..2d48f572c621 100644 --- a/gcc/testsuite/gfortran.dg/real4-8-real8-10.f90 +++ b/gcc/testsuite/gfortran.dg/real4-8-real8-10.f90 @@ -2,6 +2,7 @@ ! { dg-additional-options "-w -freal-4-real-8 -freal-8-real-10" } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -9,6 +10,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -18,6 +20,6 @@ program test print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 + if (any ([kind(r1), kind(1.0_4), kind(1.0_k4), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-8-real8-16.f90 b/gcc/testsuite/gfortran.dg/real4-8-real8-16.f90 index 3733c343d2a9..4d3e5af0eda6 100644 --- a/gcc/testsuite/gfortran.dg/real4-8-real8-16.f90 +++ b/gcc/testsuite/gfortran.dg/real4-8-real8-16.f90 @@ -3,6 +3,7 @@ ! { dg-require-effective-target fortran_real_16 } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -10,6 +11,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -19,6 +21,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 b/gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 index b83b2438a584..9f18d430c41e 100644 --- a/gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 +++ b/gcc/testsuite/gfortran.dg/real4-8-real8-4.f90 @@ -2,6 +2,7 @@ ! { dg-additional-options "-w -freal-4-real-8 -freal-8-real-4" } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -9,6 +10,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -18,6 +20,6 @@ program test print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d5)] /= 4)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real4-8.f90 b/gcc/testsuite/gfortran.dg/real4-8.f90 index 50577dd5fa85..f436b3db61e6 100644 --- a/gcc/testsuite/gfortran.dg/real4-8.f90 +++ b/gcc/testsuite/gfortran.dg/real4-8.f90 @@ -2,6 +2,7 @@ ! { dg-additional-options "-w -freal-4-real-8" } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -9,6 +10,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -18,6 +20,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 8)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 8)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real8-10.f90 b/gcc/testsuite/gfortran.dg/real8-10.f90 index 68f6bc46bce0..ce85a781974b 100644 --- a/gcc/testsuite/gfortran.dg/real8-10.f90 +++ b/gcc/testsuite/gfortran.dg/real8-10.f90 @@ -2,6 +2,7 @@ ! { dg-additional-options "-w -freal-8-real-10" } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -9,6 +10,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -18,6 +20,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 10)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real8-16.f90 b/gcc/testsuite/gfortran.dg/real8-16.f90 index 5ddd9e17bb68..b3b86c8b78a8 100644 --- a/gcc/testsuite/gfortran.dg/real8-16.f90 +++ b/gcc/testsuite/gfortran.dg/real8-16.f90 @@ -3,6 +3,7 @@ ! { dg-require-effective-target fortran_real_16 } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -10,6 +11,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -19,6 +21,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 16)) stop 2 end program test diff --git a/gcc/testsuite/gfortran.dg/real8-4.f90 b/gcc/testsuite/gfortran.dg/real8-4.f90 index a68559a26ada..c64c2973f04d 100644 --- a/gcc/testsuite/gfortran.dg/real8-4.f90 +++ b/gcc/testsuite/gfortran.dg/real8-4.f90 @@ -2,6 +2,7 @@ ! { dg-additional-options "-w -freal-8-real-4" } ! ! PR fortran/99355 +! PR fortran/99355 comment 10 to 13 + PR fortran/57871 ! program test @@ -9,6 +10,7 @@ program test real*4:: r2 real(4) :: r3 real(selected_real_kind(p=6)) :: r4 + integer, parameter :: k4 = 4, k8 = 8 double precision :: d1 real*8 :: d2 @@ -18,6 +20,6 @@ program test !print '(tr3,a10,10(tr1,i2))', 'single', kind(r1), kind(r2), kind(r3), kind(r4) !print '(tr3,a10,10(tr1,i2))', 'double', kind(d1), kind(d2), kind(d3), kind(d4), kind(d5) - if (any ([kind(1.0), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 - if (any ([kind(1.d0), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 4)) stop 2 + if (any ([kind(1.0), kind(1.0_4), kind(1.0_k4), kind(r1), kind(r2), kind(r3), kind(r4)] /= 4)) stop 1 + if (any ([kind(1.d0), kind(1.0_8), kind(1.0_k8), kind(d1), kind(d2), kind(d3), kind(d4), kind(d5)] /= 4)) stop 2 end program test