aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/check.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2011-10-28 15:15:25 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2011-10-28 15:15:25 +0000
commit58a9e3c406cfb58bddba83cf9e74b8cd7a139471 (patch)
treefafe950c42f4eaba3e345ba76cb3260be6084ac5 /gcc/fortran/check.c
parente8a25ac83c1850d2af91db335625ee7cf5cf526f (diff)
downloadgcc-58a9e3c406cfb58bddba83cf9e74b8cd7a139471.zip
gcc-58a9e3c406cfb58bddba83cf9e74b8cd7a139471.tar.gz
gcc-58a9e3c406cfb58bddba83cf9e74b8cd7a139471.tar.bz2
check.c (gfc_check_atan_2): Typo in comment.
2011-10-28 Steven G. Kargl <kargl@gcc.gnu.org> * check.c (gfc_check_atan_2): Typo in comment. (gfc_check_nearest): If 's' is constant, check that it is not 0. * simplify.c (simplify_dshift, gfc_simplify_ibclr, gfc_simplify_ibits, gfc_simplify_ibset, simplify_shift, gfc_simplify_ishftc, gfc_simplify_nearest): Remove dead code. 2011-10-28 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/nearest_5.f90: New test. From-SVN: r180618
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r--gcc/fortran/check.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 34b3a68..0f54ccd 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -934,7 +934,7 @@ null_arg:
gfc_try
gfc_check_atan_2 (gfc_expr *y, gfc_expr *x)
{
- /* gfc_notify_std would be a wast of time as the return value
+ /* gfc_notify_std would be a waste of time as the return value
is seemingly used only for the generic resolution. The error
will be: Too many arguments. */
if ((gfc_option.allow_std & GFC_STD_F2008) == 0)
@@ -2710,6 +2710,16 @@ gfc_check_nearest (gfc_expr *x, gfc_expr *s)
if (type_check (s, 1, BT_REAL) == FAILURE)
return FAILURE;
+ if (s->expr_type == EXPR_CONSTANT)
+ {
+ if (mpfr_sgn (s->value.real) == 0)
+ {
+ gfc_error ("Argument 'S' of NEAREST at %L shall not be zero",
+ &s->where);
+ return FAILURE;
+ }
+ }
+
return SUCCESS;
}