diff options
author | kargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-28 15:15:25 +0000 |
---|---|---|
committer | kargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-10-28 15:15:25 +0000 |
commit | 2f0db4b5f0465a6fe41fc9accc16fa2606d76b2e (patch) | |
tree | fafe950c42f4eaba3e345ba76cb3260be6084ac5 /gcc/fortran/check.c | |
parent | 03ed186a28c3d28ca06e2f91010f347b1f6f84a9 (diff) | |
download | gcc-2f0db4b5f0465a6fe41fc9accc16fa2606d76b2e.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180618 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r-- | gcc/fortran/check.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 34b3a68057c..0f54ccd4b63 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; } |