diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2007-06-22 01:50:09 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2007-06-22 01:50:09 +0000 |
commit | 79e7840d22610f67d5247c2ac73d908fbc77838a (patch) | |
tree | fe9a3d1004e1a4761c54706e236aad74348de33b | |
parent | 49d2bde811fc53f864e611151e7fda1e0a506ddf (diff) | |
download | gcc-79e7840d22610f67d5247c2ac73d908fbc77838a.zip gcc-79e7840d22610f67d5247c2ac73d908fbc77838a.tar.gz gcc-79e7840d22610f67d5247c2ac73d908fbc77838a.tar.bz2 |
re PR fortran/31162 (missing warning for real do-loops with implicit typed variables)
2007-06-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31162
* resolve.c (gfc_resolve_iterator_expr): Add check for REAL using
gfc_notify_standard. (gfc_resolve_iterator): Remove check.
(resolve_branch): Change "Obsolete" to "Deleted feature".
* io.c (resolve_tag): Ditto.
* match.c (gfc_match_pause, gfc_match_assign, gfc_match_goto): Ditto.
From-SVN: r125938
-rw-r--r-- | gcc/fortran/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/fortran/io.c | 2 | ||||
-rw-r--r-- | gcc/fortran/match.c | 7 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 34 |
4 files changed, 34 insertions, 18 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index a3f52ef..befa318 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2007-06-21 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/31162 + * resolve.c (gfc_resolve_iterator_expr): Add check for REAL using + gfc_notify_standard. (gfc_resolve_iterator): Remove check. + (resolve_branch): Change "Obsolete" to "Deleted feature". + * io.c (resolve_tag): Ditto. + * match.c (gfc_match_pause, gfc_match_assign, gfc_match_goto): Ditto. + 2007-06-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/32361 diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 4d12b24..aa299a3 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -1072,7 +1072,7 @@ resolve_tag (const io_tag *tag, gfc_expr *e) } else if (e->ts.type == BT_INTEGER && e->expr_type == EXPR_VARIABLE) { - if (gfc_notify_std (GFC_STD_F95_DEL, "Obsolete: ASSIGNED " + if (gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: ASSIGNED " "variable in FORMAT tag at %L", &e->where) == FAILURE) return FAILURE; diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index d1f5f41..e00c285 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -1578,7 +1578,8 @@ gfc_match_pause (void) m = gfc_match_stopcode (ST_PAUSE); if (m == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F95_DEL, "Obsolete: PAUSE statement at %C") + if (gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: PAUSE statement" + " at %C") == FAILURE) m = MATCH_ERROR; } @@ -1625,7 +1626,7 @@ gfc_match_assign (void) return MATCH_ERROR; if (gfc_match (" to %v%t", &expr) == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F95_DEL, "Obsolete: ASSIGN " + if (gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: ASSIGN " "statement at %C") == FAILURE) return MATCH_ERROR; @@ -1671,7 +1672,7 @@ gfc_match_goto (void) if (gfc_match_variable (&expr, 0) == MATCH_YES) { - if (gfc_notify_std (GFC_STD_F95_DEL, "Obsolete: Assigned GOTO " + if (gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: Assigned GOTO " "statement at %C") == FAILURE) return MATCH_ERROR; diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index cbf4f7c..8b3b29e 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -3373,15 +3373,26 @@ gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok, return FAILURE; } - if (!(expr->ts.type == BT_INTEGER - || (expr->ts.type == BT_REAL && real_ok))) + if (expr->ts.type != BT_INTEGER) { - if (real_ok) - gfc_error ("%s at %L must be INTEGER or REAL", _(name_msgid), - &expr->where); + if (expr->ts.type == BT_REAL) + { + if (real_ok) + return gfc_notify_std (GFC_STD_F95_DEL, + "Deleted feature: %s at %L must be integer", + _(name_msgid), &expr->where); + else + { + gfc_error ("%s at %L must be INTEGER", _(name_msgid), + &expr->where); + return FAILURE; + } + } else - gfc_error ("%s at %L must be INTEGER", _(name_msgid), &expr->where); - return FAILURE; + { + gfc_error ("%s at %L must be INTEGER", _(name_msgid), &expr->where); + return FAILURE; + } } return SUCCESS; } @@ -3393,11 +3404,6 @@ gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok, try gfc_resolve_iterator (gfc_iterator *iter, bool real_ok) { - - if (iter->var->ts.type == BT_REAL) - gfc_notify_std (GFC_STD_F95_DEL, "Obsolete: REAL DO loop iterator at %L", - &iter->var->where); - if (gfc_resolve_iterator_expr (iter->var, real_ok, "Loop variable") == FAILURE) return FAILURE; @@ -4572,7 +4578,7 @@ resolve_branch (gfc_st_label *label, gfc_code *code) if (stack && stack->current->next->op == EXEC_NOP) { - gfc_notify_std (GFC_STD_F95_DEL, "Obsolete: GOTO at %L jumps to " + gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: GOTO at %L jumps to " "END of construct at %L", &code->loc, &stack->current->next->loc); return; /* We know this is not an END DO. */ @@ -4586,7 +4592,7 @@ resolve_branch (gfc_st_label *label, gfc_code *code) || stack->current->op == EXEC_DO_WHILE) && stack->tail->here == label && stack->tail->op == EXEC_NOP) { - gfc_notify_std (GFC_STD_F95_DEL, "Obsolete: GOTO at %L jumps " + gfc_notify_std (GFC_STD_F95_DEL, "Deleted feature: GOTO at %L jumps " "to END of construct at %L", &code->loc, &stack->tail->loc); return; |