From: Francois-Xavier Coudert Date: Sun, 16 Aug 2015 19:47:02 +0000 (+0000) Subject: re PR fortran/54656 (ICE with software REAL(16) for NORM2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c07a5f4b4d3b5694ee8fb299ec6f3d0b866cf2d;p=gcc.git re PR fortran/54656 (ICE with software REAL(16) for NORM2) PR fortran/54656 * trans-intrinsic.c (gfc_build_intrinsic_lib_fndecls): Add decl for quadruple precision BUILT_IN_SQRT. * gfortran.dg/norm_4.f90: Rename to... * gfortran.dg/norm2_4.f90: this. * gfortran.dg/norm2_5.f90: New test. From-SVN: r226929 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4a58499de54..3a638751747 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2015-08-16 Francois-Xavier Coudert + + PR fortran/54656 + * trans-intrinsic.c (gfc_build_intrinsic_lib_fndecls): Add decl + for quadruple precision BUILT_IN_SQRT. + 2015-08-16 Francois-Xavier Coudert * trans-intrinsic.c (conv_intrinsic_ieee_is_negative): Use type diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index 60e18b8eaf5..f5b270f4bf7 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -676,6 +676,11 @@ gfc_build_intrinsic_lib_fndecls (void) #undef DEFINE_MATH_BUILTIN #undef DEFINE_MATH_BUILTIN_C + /* There is one built-in we defined manually, because it gets called + with builtin_decl_for_precision() or builtin_decl_for_float_type() + even though it is not an OTHER_BUILTIN: it is SQRT. */ + quad_decls[BUILT_IN_SQRT] = define_quad_builtin ("sqrtq", func_1, true); + } /* Add GCC builtin functions. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 221a0ab257e..28a231cc935 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2015-08-16 Francois-Xavier Coudert + + PR fortran/54656 + * gfortran.dg/norm_4.f90: Rename to... + * gfortran.dg/norm2_4.f90: this. + * gfortran.dg/norm2_5.f90: New test. + 2015-08-14 Alexandre Oliva * gcc.dg/guality/pr54200.c: Add -fno-tree-coalesce-vars. diff --git a/gcc/testsuite/gfortran.dg/norm2_4.f90 b/gcc/testsuite/gfortran.dg/norm2_4.f90 new file mode 100644 index 00000000000..276b1743f00 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/norm2_4.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } +! +! PR fortran/33197 +! +! Check implementation of L2 norm (Euclidean vector norm) +! +implicit none + +print *, norm2([1.0, 2.0]) ! { dg-error "has no IMPLICIT type" } +end diff --git a/gcc/testsuite/gfortran.dg/norm2_5.f90 b/gcc/testsuite/gfortran.dg/norm2_5.f90 new file mode 100644 index 00000000000..0416fd67b69 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/norm2_5.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! +! Testcase from PR 54656 +! Checking for NORM2 for large float kinds +! +program test + implicit none + + ! k1 and k2 will be large real kinds, if supported, and single/double + ! otherwise + integer, parameter :: k1 = & + max(selected_real_kind(precision(0.d0) + 1), kind(0.)) + integer, parameter :: k2 = & + max(selected_real_kind(precision(0._k1) + 1), kind(0.d0)) + + real(kind=k1) :: d1(10), z1 + real(kind=k2) :: d2(10), z2 + d1 = 1 ; d2 = 1 + z1 = norm2 (d1) + z2 = norm2 (d2) + + print *, z1, z2 +end program test diff --git a/gcc/testsuite/gfortran.dg/norm_4.f90 b/gcc/testsuite/gfortran.dg/norm_4.f90 deleted file mode 100644 index 276b1743f00..00000000000 --- a/gcc/testsuite/gfortran.dg/norm_4.f90 +++ /dev/null @@ -1,11 +0,0 @@ -! { dg-do compile } -! { dg-options "-std=f2003" } -! -! PR fortran/33197 -! -! Check implementation of L2 norm (Euclidean vector norm) -! -implicit none - -print *, norm2([1.0, 2.0]) ! { dg-error "has no IMPLICIT type" } -end