diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2014-10-19 20:49:27 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2014-10-19 20:49:27 +0000 |
commit | 565fad70aa35e354b628c5f94639e543a631e8e8 (patch) | |
tree | 39651a3e49d77383e3e4a37e968c07e84d8809ac /gcc/fortran/trans-const.h | |
parent | d856054bc7b4d494010234816bcb25e837eea3b1 (diff) | |
download | gcc-565fad70aa35e354b628c5f94639e543a631e8e8.zip gcc-565fad70aa35e354b628c5f94639e543a631e8e8.tar.gz gcc-565fad70aa35e354b628c5f94639e543a631e8e8.tar.bz2 |
re PR fortran/48979 (FRACTION und EXPONENT return invalid results for infinity/NaN)
PR fortran/48979
* trans-const.c (gfc_build_nan): New function.
* trans-const.h (gfc_build_nan): New prototype.
* trans-intrinsic.c (gfc_conv_intrinsic_exponent): Handle special
values.
(gfc_conv_intrinsic_minmaxval): Use gfc_build_nan.
(gfc_conv_intrinsic_fraction): Handle special values.
(gfc_conv_intrinsic_spacing): Likewise.
(gfc_conv_intrinsic_rrspacing): Likewise.
(gfc_conv_intrinsic_set_exponent): Likewise.
* gfortran.dg/ieee/intrinsics_2.F90: New test.
From-SVN: r216443
Diffstat (limited to 'gcc/fortran/trans-const.h')
-rw-r--r-- | gcc/fortran/trans-const.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/trans-const.h b/gcc/fortran/trans-const.h index 42ffe69..b1f1910 100644 --- a/gcc/fortran/trans-const.h +++ b/gcc/fortran/trans-const.h @@ -30,6 +30,10 @@ void gfc_conv_tree_to_mpfr (mpfr_ptr, tree); not supported for the given type. */ tree gfc_build_inf_or_huge (tree, int); +/* Build a tree containing a NaN for the given type, with significand + specified by second argument. */ +tree gfc_build_nan (tree, const char *); + /* Build a tree for a constant. Must be an EXPR_CONSTANT gfc_expr. For CHARACTER literal constants, the caller still has to set the string length as a separate operation. */ |