Hi Rainer, >> Attached is a more complete patch, which should fix all problems that >> were reported concerning these two test cases. Would be great if >> someone could confirm that it works on a failing target (I currently >> only have access to x86_64-linux-gnu machines). > > I've just checked sparc-sun-solaris2.11: works fine. promotion_3.f90 > PASSes as before, but promotion_4.f90 is now UNSUPPORTED instead of > failing.
thanks for checking! >> Ok for trunk? > > The new fortran_real_10 effective-target keyword needs documenting in > sourcebuild.texi. Good point. fortran_real_16 was missing there as well. Added both (new patch attached). I'll commit this tonight, unless there are further comments ... Cheers, Janus
Index: gcc/doc/sourcebuild.texi =================================================================== --- gcc/doc/sourcebuild.texi (revision 253134) +++ gcc/doc/sourcebuild.texi (working copy) @@ -1357,6 +1357,12 @@ Target has runtime support for any options added w @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)}. Index: gcc/testsuite/gfortran.dg/promotion_3.f90 =================================================================== --- gcc/testsuite/gfortran.dg/promotion_3.f90 (revision 253134) +++ gcc/testsuite/gfortran.dg/promotion_3.f90 (working copy) @@ -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 ! Index: gcc/testsuite/gfortran.dg/promotion_4.f90 =================================================================== --- gcc/testsuite/gfortran.dg/promotion_4.f90 (revision 253134) +++ gcc/testsuite/gfortran.dg/promotion_4.f90 (working copy) @@ -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 Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (revision 253134) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -1464,7 +1464,21 @@ 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. #