[Bug fortran/82086] namelist read with repeat count fails when item is member of array of structures
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82086 --- Comment #11 from jsberg at bnl dot gov --- Presumably the "repeat count too large" test fails. The basic requirement is that the number of input values cannot exceed the number of number of items in the designator to the left; the repeat count contributes to the total number of input values. Thus somewhere in the parsing logic there should be some code computing the size of the designator and some code computing the number of input values. It appears that the problem is in gfortran not seeing ta(1:8)%c as being an array section for the purpose of this count. But the count check needs to happen somewhere, if that test case in namelist_19.f90 fails then the excess number of input values is not getting flagged. Without the count check, do the right values get loaded into the array?
[Bug fortran/82086] namelist read with repeat count fails when item is member of array of structures
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82086 --- Comment #7 from jsberg at bnl dot gov --- As to why I think this is a bug (and why I think Intel's compiler is doing the right thing), referencing the 2008 standard (N1830): 10.11.2, paragraph 2: Each object designator shall begin with a name from the namelist-group-object-list (5.6) and shall follow the syntax of designator (R601). 10.11.3.2, paragraph 2: When the designator in the input record represents an array variable or a variable of derived type, the effect is as if the variable represented were expanded into a sequence of scalar list items, in the same way that formatted input/output list items are expanded (9.6.3). 10.11.3.3, paragraph 1: ... The r*c form is equivalent to r successive appearances of the constant c R601 designator is object-name or array-element or array-section or coindexed-named-object or complex-part-designator or structure-component or substring R611 data-ref is part-ref [ % part-ref ] ... R612 part-ref is part-name [ ( section-subscript-list ) ] [ image-selector ] R618 array-section is data-ref [ ( substring-range ) ] or complex-part-designator
[Bug fortran/82086] New: namelist read with repeat count fails when item is member of array of structures
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82086 Bug ID: 82086 Summary: namelist read with repeat count fails when item is member of array of structures Product: gcc Version: 7.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jsberg at bnl dot gov Target Milestone: --- This program: program t170902a implicit none type t character(64) :: c='' end type t type(t), dimension(16) :: ta namelist /n/ta open(1,file='170902a.txt') read(1,nml=n) end program t170902a With this text in '170902a.txt': ta(1:8)%c = 8*'bogus' / Gives the following on execution: At line 10 of file 170902a.f90 (unit = 1, file = '170902a.txt') Fortran runtime error: Repeat count too large for namelist object ta%c Error termination. Backtrace: Could not print backtrace: libbacktrace could not find executable to open #0 0x #1 0x #2 0x #3 0x #4 0x #5 0x #6 0x #7 0x #8 0x #9 0x #10 0x #11 0x #12 0x Compiler command line: gfortran.exe -Wall -Wextra 170902a.f90 -o 170902a.exe gcc -v: Using built-in specs. COLLECT_GCC=\mingw64-7_1_0\bin\gfortran.exe COLLECT_LTO_WRAPPER=C:/mingw64-7_1_0/bin/../libexec/gcc/x86_64-w64-mingw32/7.1.0/lto-wrapper.exe Target: x86_64-w64-mingw32 Configured with: ../../../src/gcc-7.1.0/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw710/x86_64-710-win32-seh-rt_v5-rev2/mingw64 --enable-shared --enable-static --disable-multilib --enable-languages=c,c++,fortran,lto --enable-libstdcxx-time=yes --enable-threads=win32 --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --enable-libstdcxx-filesystem-ts=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw710/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw710/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw710/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw710/prerequisites/x86_64-w64-mingw32-static --with-pkgversion='x86_64-win32-seh-rev2, Built by MinGW-W64 project' --with-bugurl=https://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -fno-ident -I/c/mingw710/x86_64-710-win32-seh-rt_v5-rev2/mingw64/opt/include -I/c/mingw710/prerequisites/x86_64-zlib-static/include -I/c/mingw710/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -fno-ident -I/c/mingw710/x86_64-710-win32-seh-rt_v5-rev2/mingw64/opt/include -I/c/mingw710/prerequisites/x86_64-zlib-static/include -I/c/mingw710/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS=' -I/c/mingw710/x86_64-710-win32-seh-rt_v5-rev2/mingw64/opt/include -I/c/mingw710/prerequisites/x86_64-zlib-static/include -I/c/mingw710/prerequisites/x86_64-w64-mingw32-static/include' LDFLAGS='-pipe -fno-ident -L/c/mingw710/x86_64-710-win32-seh-rt_v5-rev2/mingw64/opt/lib -L/c/mingw710/prerequisites/x86_64-zlib-static/lib -L/c/mingw710/prerequisites/x86_64-w64-mingw32-static/lib ' Thread model: win32 gcc version 7.1.0 (x86_64-win32-seh-rev2, Built by MinGW-W64 project)
[Bug fortran/24204] ICE (segfault)
--- Comment #5 from jsberg at bnl dot gov 2005-10-05 13:31 --- Created an attachment (id=9891) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9891action=view) tpsalie_analysis.mod -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24204
[Bug fortran/24204] ICE (segfault)
--- Comment #6 from jsberg at bnl dot gov 2005-10-05 13:35 --- Created an attachment (id=9893) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9893action=view) precision_constants.mod Sorry about that--I don't know much about fortran9x... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24204
[Bug fortran/24204] ICE (segfault)
--- Comment #8 from jsberg at bnl dot gov 2005-10-05 19:41 --- Yup, I pulled the CVS and it works for me to. -- jsberg at bnl dot gov changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24204
[Bug fortran/24204] New: ICE (segfault)
Sorry, Fortran 90 isn't my gig; can't tell you much more. Code follows. -- Summary: ICE (segfault) Product: gcc Version: 4.0.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jsberg at bnl dot gov GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24204
[Bug fortran/24204] ICE (segfault)
--- Comment #1 from jsberg at bnl dot gov 2005-10-04 22:33 --- Created an attachment (id=9884) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9884action=view) The source file that fails -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24204
[Bug fortran/24204] ICE (segfault)
--- Comment #2 from jsberg at bnl dot gov 2005-10-04 22:34 --- Created an attachment (id=9885) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9885action=view) Small change from previous, this one doesn't ICE -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24204
[Bug fortran/24204] ICE (segfault)
--- Comment #3 from jsberg at bnl dot gov 2005-10-04 22:35 --- $ gfortran4 -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.0.2/configure --prefix=/opt/gcc-4.0.2 --program-suffix=4 --enable-threads --with-arch=pentium4 --with-tune=pentium4 --enable-__cxa_atexit --with-gmp=/opt/gmp-4.1.4 --with-mpfr=/opt/mpfr-2.2.0 --with-system-zlib Thread model: posix gcc version 4.0.2 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24204