This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [gfortran, PR 18540] A few statement label cleanups
Steve Kargl wrote:
> Tobi, I've read the patch and believe that it is correct.
> I particularly like the clean up of the unused 'cnt' variable
> that I added in a few places. Although I can't test the
> patch at the moment, I think it should be committed to trunk.
> In a week or so, the patch can be committed to 4.1.
I've committed the hunk which allows cross-block jumps together with the
testcase to 4.1, I don't think the rest is really appropriate. For reference
I copied what I committed below.
I also noticed that the ChangeLog I committed with the original patch to the
trunk in r109914 was incomplete. I fixed this.
Regards,
- Tobi
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 110227)
+++ gcc/fortran/resolve.c (working copy)
@@ -3552,9 +3552,12 @@ resolve_branch (gfc_st_label * label, gf
if (found == NULL)
{
- /* still nothing, so illegal. */
- gfc_error_now ("Label at %L is not in the same block as the "
- "GOTO statement at %L", &lp->where, &code->loc);
+ /* The label is not in an enclosing block, so illegal. This was
+ allowed in Fortran 66, so we allow it as extension. We also
+ forego further checks if we run into this. */
+ gfc_notify_std (GFC_STD_LEGACY,
+ "Label at %L is not in the same block as the "
+ "GOTO statement at %L", &lp->where, &code->loc);
return;
}
Index: gcc/fortran/ChangeLog
===================================================================
--- gcc/fortran/ChangeLog (revision 110227)
+++ gcc/fortran/ChangeLog (working copy)
@@ -1,3 +1,10 @@
+2005-01-25 Steven Bosscher <stevenb.gcc@gmail.com>
+ Tobias Schlter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/18540
+ * resolve.c (resolve_branch): Allow FORTRAN 66 cross-block GOTOs
+ as extension.
+
2005-01-23 Paul Thomas <pault@gcc.gnu.org>
Fix regression in testing of admissability of attributes.