https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107237

            Bug ID: 107237
           Summary: Error: non-constant array in DATA statement (1)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ptw at tpointsw dot uk
  Target Milestone: ---

Apologies if this report is incomplete or blemished. Hopefully the example is
sufficiently concise that the problem will be easy to reproduce.

Using gfortran under Windows 10, this apparently valid Fortran code:

      REAL A(4)
      DATA A(l), A(2), A(3), A(4) /0.0, 0.0, 0.0, 0.0/
      PRINT *, A(1)
      END

produces the reports:

       DATA A(l), A(2), A(3), A(4) /0.0, 0.0, 0.0, 0.0/
            1
Error: non-constant array in DATA statement (1)

       DATA A(l), A(2), A(3), A(4) /0.0, 0.0, 0.0, 0.0/
          1
Error: Data element below array lower bound at (1)

Output from gfortran -v is as follows:
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu
--host=mingw32 --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw
--with-isl=/mingw --prefix=/mingw --disable-win32-registry --target=mingw32
--with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada
--with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared
--enable-threads --with-dwarf2 --disable-sjlj-exceptions
--enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw
--with-libintl-prefix=/mingw --enable-libstdcxx-debug --with-tune=generic
--enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)

I get the same errors on a recently built Ubuntu platform.

Reply via email to