diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-14 10:26:11 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-08-14 10:26:11 +0000 |
commit | 2c46015e2b5b6cf51def16f06cb320e79fa3920d (patch) | |
tree | fd8ae21355514bd9c9b84fa2b0cf9abb625369da /gcc/fortran/symbol.c | |
parent | 4b02020f3a36b70d329cb2656377939c52cf44ca (diff) | |
download | gcc-2c46015e2b5b6cf51def16f06cb320e79fa3920d.tar.gz |
2012-08-14 Tobias Burnus <burnus@net-b.de>
PR fortran/40881
* error.c (gfc_notify_std): Reset cur_error_buffer->flag flag
when the error/warning has been printed.
* gfortran.h (gfc_sl_type): Add ST_LABEL_DO_TARGET.
* match.c (gfc_match_do): Use ST_LABEL_DO_TARGET.
* parse.c (check_statement_label): Use ST_LABEL_DO_TARGET.
(parse_executable): Add obsolescence check for DATA.
* resolve.c (resolve_branch): Handle ST_LABEL_DO_TARGET.
* symbol.c (gfc_define_st_label, gfc_reference_st_label):
Add obsolescence diagnostics.
* trans-stmt.c (gfc_trans_label_assign): Handle
* ST_LABEL_DO_TARGET.
2012-08-14 Tobias Burnus <burnus@net-b.de>
PR fortran/40881
* gfortran.dg/data_constraints_3.f90: New.
* gfortran.dg/data_constraints_1.f90: Add dg-options ""
to disable -pedantic compilation.
* gfortran.dg/pr37243.f: Ditto.
* gfortran.dg/g77/19990826-3.f: Ditto.
* gfortran.dg/g77/20020307-1.f : Ditto.
* gfortran.dg/g77/980310-3.f: Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190379 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 455e6c98951..5a1e5adb85c 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2204,7 +2204,8 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type type, locus *label_locus) switch (type) { case ST_LABEL_FORMAT: - if (lp->referenced == ST_LABEL_TARGET) + if (lp->referenced == ST_LABEL_TARGET + || lp->referenced == ST_LABEL_DO_TARGET) gfc_error ("Label %d at %C already referenced as branch target", labelno); else @@ -2213,12 +2214,18 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type type, locus *label_locus) break; case ST_LABEL_TARGET: + case ST_LABEL_DO_TARGET: if (lp->referenced == ST_LABEL_FORMAT) gfc_error ("Label %d at %C already referenced as a format label", labelno); else - lp->defined = ST_LABEL_TARGET; + lp->defined = type; + if (lp->referenced == ST_LABEL_DO_TARGET && type != ST_LABEL_DO_TARGET + && gfc_notify_std (GFC_STD_F95_OBS, "DO termination statement " + "which is not END DO or CONTINUE with label " + "%d at %C", labelno) == FAILURE) + return; break; default: @@ -2254,14 +2261,16 @@ gfc_reference_st_label (gfc_st_label *lp, gfc_sl_type type) lp->where = gfc_current_locus; } - if (label_type == ST_LABEL_FORMAT && type == ST_LABEL_TARGET) + if (label_type == ST_LABEL_FORMAT + && (type == ST_LABEL_TARGET || type == ST_LABEL_DO_TARGET)) { gfc_error ("Label %d at %C previously used as a FORMAT label", labelno); rc = FAILURE; goto done; } - if ((label_type == ST_LABEL_TARGET || label_type == ST_LABEL_BAD_TARGET) + if ((label_type == ST_LABEL_TARGET || label_type == ST_LABEL_DO_TARGET + || label_type == ST_LABEL_BAD_TARGET) && type == ST_LABEL_FORMAT) { gfc_error ("Label %d at %C previously used as branch target", labelno); @@ -2269,7 +2278,13 @@ gfc_reference_st_label (gfc_st_label *lp, gfc_sl_type type) goto done; } - lp->referenced = type; + if (lp->referenced == ST_LABEL_DO_TARGET && type == ST_LABEL_DO_TARGET + && gfc_notify_std (GFC_STD_F95_OBS, "Shared DO termination label %d " + "at %C", labelno) == FAILURE) + return FAILURE; + + if (lp->referenced != ST_LABEL_DO_TARGET) + lp->referenced = type; rc = SUCCESS; done: |