From: Steven G. Kargl Date: Mon, 5 Aug 2019 19:24:31 +0000 (+0000) Subject: re PR fortran/91372 (Error: Unclassifiable statement) X-Git-Tag: misc/cutover-git~3646 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=719f5a10e750ab216700d13074122ac410bf106f;p=thirdparty%2Fgcc.git re PR fortran/91372 (Error: Unclassifiable statement) 2019-08-05 Steven g. Kargl PR fortran/91372 * decl.c (gfc_match_data): Allow an implied do-loop to nestle against DATA. 2019-08-05 Steven g. Kargl PR fortran/91372 * gfortran.dg/pr91372.f90: New test. From-SVN: r274122 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 534ae3575d0f..9835cbb6bc41 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2019-08-05 Steven g. Kargl + + PR fortran/91372 + * decl.c (gfc_match_data): Allow an implied do-loop to nestle against + DATA. + 2019-08-04 Steven G. Kargl PR fortran/88227 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 1415b97267fe..7a442cac0ea4 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -624,9 +624,10 @@ gfc_match_data (void) char c; /* DATA has been matched. In free form source code, the next character - needs to be whitespace. Check that here. */ + needs to be whitespace or '(' from an implied do-loop. Check that + here. */ c = gfc_peek_ascii_char (); - if (gfc_current_form == FORM_FREE && !gfc_is_whitespace (c)) + if (gfc_current_form == FORM_FREE && !gfc_is_whitespace (c) && c != '(') return MATCH_NO; /* Before parsing the rest of a DATA statement, check F2008:c1206. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0e8e141bba6a..917a75f54132 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-08-05 Steven g. Kargl + + PR fortran/91372 + * gfortran.dg/pr91372.f90: New test. + 2019-08-05 Marek Polacek PR c++/91338 - Implement P1161R3: Deprecate a[b,c]. diff --git a/gcc/testsuite/gfortran.dg/pr91372.f90 b/gcc/testsuite/gfortran.dg/pr91372.f90 new file mode 100644 index 000000000000..b9483141eb65 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr91372.f90 @@ -0,0 +1,9 @@ +! { dg-do compile } +! PR fortran/91372 +module module_sf_lake + implicit none + integer, parameter :: r8 = selected_real_kind(12) + integer, private :: i + real(r8) :: sand(2) ! percent sand + data(sand(i), i=1,2)/92.,80./ +end module module_sf_lake