aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2010-06-25 21:40:37 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2010-06-25 21:40:37 +0200
commit01349049e8a5e3d82ea0344c7628024a7c936a3a (patch)
tree0227f439c097f371c197a8473efb939d6bb3803b /gcc/fortran/check.c
parent849cab7b758a2da9c739de3af5d42bb252a1db5f (diff)
downloadgcc-01349049e8a5e3d82ea0344c7628024a7c936a3a.zip
gcc-01349049e8a5e3d82ea0344c7628024a7c936a3a.tar.gz
gcc-01349049e8a5e3d82ea0344c7628024a7c936a3a.tar.bz2
intrinsic.h (gfc_check_selected_real_kind, [...]): Update prototypes.
2010-06-25 Tobias Burnus <burnus@net-b.de> * intrinsic.h (gfc_check_selected_real_kind, gfc_simplify_selected_real_kind): Update prototypes. * intrinsic.c (add_functions): Add radix support to selected_real_kind. * check.c (gfc_check_selected_real_kind): Ditto. * simplify.c (gfc_simplify_selected_real_kind): Ditto. * trans-decl.c (gfc_build_intrinsic_function_decls): Change call from selected_real_kind to selected_real_kind2008. * intrinsic.texi (SELECTED_REAL_KIND): Update for radix. (PRECISION, RANGE, RADIX): Add cross @refs. 2010-06-25 Tobias Burnus <burnus@net-b.de> * intrinsics/selected_real_kind.f90 (_gfortran_selected_real_kind2008): Add function. (_gfortran_selected_real_kind): Stub which calls _gfortran_selected_real_kind2008. * gfortran.map (GFORTRAN_1.4): Add _gfortran_selected_real_kind2008. * mk-srk-inc.sh: Save also RADIX. 2010-06-25 Tobias Burnus <burnus@net-b.de> * selected_real_kind_2.f90: New. * selected_real_kind_3.f90: New. From-SVN: r161411
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 81f3e24..3452717 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -2920,15 +2920,13 @@ gfc_check_selected_int_kind (gfc_expr *r)
gfc_try
-gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r)
+gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r, gfc_expr *radix)
{
- if (p == NULL && r == NULL)
- {
- gfc_error ("Missing arguments to %s intrinsic at %L",
- gfc_current_intrinsic, gfc_current_intrinsic_where);
-
- return FAILURE;
- }
+ if (p == NULL && r == NULL
+ && gfc_notify_std (GFC_STD_F2008, "Fortran 2008: SELECTED_REAL_KIND with"
+ " neither 'P' nor 'R' argument at %L",
+ gfc_current_intrinsic_where) == FAILURE)
+ return FAILURE;
if (p)
{
@@ -2948,6 +2946,20 @@ gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r)
return FAILURE;
}
+ if (radix)
+ {
+ if (type_check (radix, 1, BT_INTEGER) == FAILURE)
+ return FAILURE;
+
+ if (scalar_check (radix, 1) == FAILURE)
+ return FAILURE;
+
+ if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: '%s' intrinsic with "
+ "RADIX argument at %L", gfc_current_intrinsic,
+ &radix->where) == FAILURE)
+ return FAILURE;
+ }
+
return SUCCESS;
}