From: Harald Anlauf Date: Mon, 30 Aug 2021 21:07:56 +0000 (+0200) Subject: Fortran - fix whitespace issue during parsing of assigned goto X-Git-Tag: basepoints/gcc-13~5080 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a7083b83e45852540a4a09ee11b74dc28d777399;p=thirdparty%2Fgcc.git Fortran - fix whitespace issue during parsing of assigned goto gcc/fortran/ChangeLog: PR fortran/102113 * match.c (gfc_match_goto): Allow for whitespace in parsing list of labels. gcc/testsuite/ChangeLog: PR fortran/102113 * gfortran.dg/goto_9.f90: New test. --- diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 16502da001d3..53a575e616e2 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -4079,7 +4079,7 @@ gfc_match_goto (void) } while (gfc_match_char (',') == MATCH_YES); - if (gfc_match (")%t") != MATCH_YES) + if (gfc_match (" )%t") != MATCH_YES) goto syntax; if (head == NULL) diff --git a/gcc/testsuite/gfortran.dg/goto_9.f90 b/gcc/testsuite/gfortran.dg/goto_9.f90 new file mode 100644 index 000000000000..e05e73819e68 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goto_9.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! { dg-options "-std=legacy" } +! PR fortran/102113 - parsing error in assigned goto + +program p + assign 10 to i + goto i,(10,20 ) +10 continue +20 continue +end