From: Janus Weil Date: Tue, 26 Sep 2017 20:28:00 +0000 (+0200) Subject: re PR fortran/82143 (add a -fdefault-real-16 flag) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=63b62fa05bde3d79396c2b2a3afe483621e84cfc;p=gcc.git re PR fortran/82143 (add a -fdefault-real-16 flag) 2017-09-26 Janus Weil PR fortran/82143 PR fortran/82324 * doc/sourcebuild.texi: Document fortran_real_10 and fortran_real_16. 2017-09-26 Janus Weil PR fortran/82143 PR fortran/82324 * lib/target-supports.exp (check_effective_target_fortran_real_10): New. * gfortran.dg/promotion_3.f90: Only run if real(16) is available. * gfortran.dg/promotion_4.f90: Only run if real(10) is available. Don't assume that DOUBLE PRECISION has kind=16. From-SVN: r253214 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 54acc7810f7..d80b6a07c13 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-09-26 Janus Weil + + PR fortran/82143 + PR fortran/82324 + * doc/sourcebuild.texi: Document fortran_real_10 and fortran_real_16. + 2017-09-26 Michael Meissner * config/rs6000/rs6000.md (extendsi2): Add a splitter to do diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 9901c940e79..56e1b4eb103 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1357,6 +1357,12 @@ Target has runtime support for any options added with @item fortran_integer_16 Target supports Fortran @code{integer} that is 16 bytes or longer. +@item fortran_real_10 +Target supports Fortran @code{real} that is 10 bytes or longer. + +@item fortran_real_16 +Target supports Fortran @code{real} that is 16 bytes or longer. + @item fortran_large_int Target supports Fortran @code{integer} kinds larger than @code{integer(8)}. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 697d0639dc5..38591f42c89 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2017-09-26 Janus Weil + + PR fortran/82143 + PR fortran/82324 + * lib/target-supports.exp (check_effective_target_fortran_real_10): New. + * gfortran.dg/promotion_3.f90: Only run if real(16) is available. + * gfortran.dg/promotion_4.f90: Only run if real(10) is available. + Don't assume that DOUBLE PRECISION has kind=16. + 2017-09-26 Thomas Koenig * gfortran.dg/gomp/associate1.f90: Really commit change diff --git a/gcc/testsuite/gfortran.dg/promotion_3.f90 b/gcc/testsuite/gfortran.dg/promotion_3.f90 index 7c9b5917fc8..3571bd175b2 100644 --- a/gcc/testsuite/gfortran.dg/promotion_3.f90 +++ b/gcc/testsuite/gfortran.dg/promotion_3.f90 @@ -1,5 +1,6 @@ ! { dg-do run } ! { dg-options "-fdefault-real-16" } +! { dg-require-effective-target fortran_real_16 } ! ! PR 82143: add a -fdefault-real-16 flag ! diff --git a/gcc/testsuite/gfortran.dg/promotion_4.f90 b/gcc/testsuite/gfortran.dg/promotion_4.f90 index 0aa1c8edbc4..8378cdd264a 100644 --- a/gcc/testsuite/gfortran.dg/promotion_4.f90 +++ b/gcc/testsuite/gfortran.dg/promotion_4.f90 @@ -1,5 +1,6 @@ ! { dg-do run } ! { dg-options "-fdefault-real-10" } +! { dg-require-effective-target fortran_real_10 } ! ! PR 82143: add a -fdefault-real-16 flag ! @@ -12,5 +13,5 @@ double precision :: d if (kind(r4) /= 4) call abort if (kind(r8) /= 8) call abort if (kind(r) /= 10) call abort -if (kind(d) /= 16) call abort +if (kind(d) < 10) call abort end diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 8b2579798ee..57f646ce2df 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1464,6 +1464,20 @@ proc check_effective_target_fortran_real_16 { } { }] } +# Return 1 if the target supports Fortran real kind 10, +# 0 otherwise. Contrary to check_effective_target_fortran_large_real +# this checks for real(10) only. +# +# When the target name changes, replace the cached result. + +proc check_effective_target_fortran_real_10 { } { + return [check_no_compiler_messages fortran_real_10 executable { + ! Fortran + real(kind=10) :: x + x = cos (x) + end + }] +} # Return 1 if the target supports Fortran's IEEE modules, # 0 otherwise.