diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2008-01-24 08:40:38 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2008-01-24 08:40:38 +0000 |
commit | ae18bd76ae240408d959113a016510f36cfb19c6 (patch) | |
tree | 72588c3c651570f75fb640cbec283fef41a30f79 /gcc/fortran/parse.c | |
parent | d82b58c2ac67d1affc0218dc9141e7a99af882cc (diff) | |
download | gcc-ae18bd76ae240408d959113a016510f36cfb19c6.zip gcc-ae18bd76ae240408d959113a016510f36cfb19c6.tar.gz gcc-ae18bd76ae240408d959113a016510f36cfb19c6.tar.bz2 |
re PR fortran/34872 (Spurious error in snapshot of 01/18/08: Statement at (1) is not a valid branch target statement for the branch statement at (2))
2008-01-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34872
* parse.c (next_statement) : If ST_GET_FCN_CHARACTERISTICS is
seen, check for a statement label and, if present, delete it
and set the locus to the start of the statement.
2008-01-24 Paul Thomas <pault@gcc.gnu.org>
PR fortran/34872
* gfortran.dg/function_charlen_3.f: New test.
From-SVN: r131777
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r-- | gcc/fortran/parse.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 64d8c33..20777fd 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -795,7 +795,7 @@ static gfc_statement next_statement (void) { gfc_statement st; - + locus old_locus; gfc_new_block = NULL; for (;;) @@ -824,6 +824,8 @@ next_statement (void) if (gfc_define_undef_line ()) continue; + old_locus = gfc_current_locus; + st = (gfc_current_form == FORM_FIXED) ? next_fixed () : next_free (); if (st != ST_NONE) @@ -832,6 +834,13 @@ next_statement (void) gfc_buffer_error (0); + if (st == ST_GET_FCN_CHARACTERISTICS && gfc_statement_label != NULL) + { + gfc_free_st_label (gfc_statement_label); + gfc_statement_label = NULL; + gfc_current_locus = old_locus; + } + if (st != ST_NONE) check_statement_label (st); |