using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease) with '-g -pedantic -std=f95', I get a bad / no diagnostic for the following invalid code: 0 CONTINUE END
I have a tentative patch for this.
Confirmed.
Subject: Bug 25106 Author: fxcoudert Date: Sat Dec 3 15:32:04 2005 New Revision: 107999 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107999 Log: PR fortran/25106 * parse.c (next_free): Use new prototype for gfc_match_st_label. Correctly emit hard error if a label is zero. * match.c (gfc_match_st_label): Never allow zero as a valid label. (gfc_match, gfc_match_do, gfc_match_goto): Use new prototype for gfc_match_st_label. * primary.c (): Use new prototype for gfc_match_st_label. * io.c (): Likewise. * match.h: Likewise. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/io.c trunk/gcc/fortran/match.c trunk/gcc/fortran/match.h trunk/gcc/fortran/parse.c trunk/gcc/fortran/primary.c
Patch commited to mainline, waiting some time before commiting to 4.1.
http://gcc.gnu.org/ml/fortran/2005-12/msg00215.html This patch changes the handling of labels to catch problems with too many digits from laeding zeros.
Subject: Bug 25106 Author: kargl Date: Fri Dec 16 23:32:29 2005 New Revision: 108692 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108692 Log: 2005-12-10 Steven G. Kargl <kargls@comcast.net> PR fortran/25106 PR fortran/25055 * match.c (gfc_match_small_literal_int): Add cnt argument; (gfc_match_st_label,gfc_match_stopcode): Account for cnt argument. * match.h (gfc_match_small_literal_int): Update prototype. * decl.c (match_char_length,gfc_match_old_kind_spec): Account for cnt. * parse.c (next_free): Ditto. * primary.c (match_kind_param): Ditto. gfortran.dg/label_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/label_1.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/fortran/match.c trunk/gcc/fortran/match.h trunk/gcc/fortran/parse.c trunk/gcc/fortran/primary.c trunk/gcc/testsuite/ChangeLog
*** Bug 20855 has been marked as a duplicate of this bug. ***
Subject: Bug 25106 Author: kargl Date: Sat Dec 31 18:55:30 2005 New Revision: 109199 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109199 Log: 2005-12-31 Steven G. Kargl <kargls@comcast.net> PR fortran/25106 PR fortran/25055 * io.c (match_dt_format): Remove second arg in gfc_match_st_label. * match.c (gfc_match_small_literal_int): Add cnt argument; (gfc_match_st_label,gfc_match_stopcode): Account for cnt argument. (gfc_match_st_label): Remove allow_zero (second argument), and use cnt for errors. (gfc_match_do,gfc_match_goto): Remove second arg in gfc_match_st_label * match.h (gfc_match_small_literal_int,gfc_match_st_label): Update prototypes. * decl.c (match_char_length,gfc_match_old_kind_spec): Account for cnt. * parse.c (next_free): Account for cnt; Remove second arg in gfc_match_st_label * primary.c (match_kind_param): Ditto. PR fortran/25106 PR fortran/25055 * gfortran.dg/label_1.f90: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/label_1.f90 Modified: branches/gcc-4_1-branch/gcc/fortran/ChangeLog branches/gcc-4_1-branch/gcc/fortran/decl.c branches/gcc-4_1-branch/gcc/fortran/io.c branches/gcc-4_1-branch/gcc/fortran/match.c branches/gcc-4_1-branch/gcc/fortran/match.h branches/gcc-4_1-branch/gcc/fortran/parse.c branches/gcc-4_1-branch/gcc/fortran/primary.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed in 4.1 and trunk. This will not be fixed (by me) in 4.0.