Bug 91372 - Error: Unclassifiable statement
Summary: Error: Unclassifiable statement
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 10.0
: P4 trivial
Target Milestone: 10.0
Assignee: kargls
URL:
Keywords:
Depends on: 90985
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-05 18:22 UTC by H.J. Lu
Modified: 2019-08-05 19:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2019-08-05 18:22:14 UTC
r274054 gave:

[hjl@gnu-skl-2 build_base_gcc-m64.0000]$ cat foo.f90 
MODULE module_sf_lake

    implicit none 
    integer, parameter ::      r8 = selected_real_kind(12) 

    integer, private  :: i  ! loop index 
    real(r8) :: sand(19)                           ! percent sand

    data(sand(i), i=1,19)/92.,80.,66.,20.,5.,43.,60.,&
      10.,32.,51., 6.,22.,39.7,0.,100.,54.,17.,100.,92./

END MODULE module_sf_lake
[hjl@gnu-skl-2 build_base_gcc-m64.0000]$ /export/gnu/import/git/gcc-test-spec/usr/bin/gfortran  -m64 -c -o module_sf_lake.fppized.o -I. -I./netcdf/include -I./inc -fno-unsafe-math-optimizations -mfpmath=sse -march=native -O2 -fconvert=big-endian  foo.f90
foo.f90:9:4:

    9 |     data(sand(i), i=1,19)/92.,80.,66.,20.,5.,43.,60.,&
      |    1
Error: Unclassifiable statement at (1)
[hjl@gnu-skl-2 build_base_gcc-m64.0000]$
Comment 1 kargls 2019-08-05 18:44:31 UTC
(In reply to H.J. Lu from comment #0)
> r274054 gave:
> 
> [hjl@gnu-skl-2 build_base_gcc-m64.0000]$ cat foo.f90 > 

> 
>     9 |     data(sand(i), i=1,19)/92.,80.,66.,20.,5.,43.,60.,&


The code is invalid.

Free-form source code requires whitespace after "DATA".
Comment 2 Steve Kargl 2019-08-05 19:02:59 UTC
On Mon, Aug 05, 2019 at 06:44:31PM +0000, kargl at gcc dot gnu.org wrote:
> 
> The code is invalid.
> 
> Free-form source code requires whitespace after "DATA".
> 

So my reading to 

R837 data-stmt  is DATA data-stmt-set [ [ , ] data-stmt-set ] ...

may have been to strict.  The standard has

  A blank shall be used to separate names, constants, or labels
  from adjacent keywords, names, constants, or labels. 

The '(' isn't a name, constant, or label, so the blank may
be omitted.  Easy to fix.
Comment 3 kargls 2019-08-05 19:25:03 UTC
Author: kargl
Date: Mon Aug  5 19:24:31 2019
New Revision: 274122

URL: https://gcc.gnu.org/viewcvs?rev=274122&root=gcc&view=rev
Log:
2019-08-05  Steven g. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91372
	* decl.c (gfc_match_data): Allow an implied do-loop to nestle against
	DATA.

2019-08-05  Steven g. Kargl  <kargl@gcc.gnu.org>

	PR fortran/91372
	* gfortran.dg/pr91372.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/pr91372.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/testsuite/ChangeLog
Comment 4 kargls 2019-08-05 19:54:58 UTC
Fixed.  Sorry about the confusion.