https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83522
Paul Thomas <pault at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pault at gcc dot gnu.org
--- Comment #12 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #11)
> I admit I'm not a Fortran language lawyer, but I actually don't see why
> (:)(:) is invalid.
> It is not a substring non-terminal in that case, sure, because R908/R909
> require parent-string to be array-element or some scalar.
> But, R918 then has:
> array-section is data-ref [ ( substring-range ) ]
> or complex-part-designator
> and if C925/C296 conditions are met, it is a valid array section, for which
> then 9.5.3.1/1 says what it means (everything from
> https://j3-fortran.org/doc/year/18/18-007.pdf
> ). So, IMNSHO the patch needs to be reverted.
Hi Jakub,
I have just seen your comment having written an email to the list to the same
effect:
The section from the standard in comment #2 is being misinterpreted.
R609 and R610 concern substrings in the context of section 6.4, which
concerns SCALARS!
Section 6.5 concerns arrays and you will find there:
R618 array-section is data-ref [ ( substring-range ) ] or
complex-part-designator
C624 (R618) Exactly one part-ref shall have nonzero rank, and either
the final part-ref shall have a section-
subscript-list with nonzero rank, another part-ref shall have nonzero
rank, or the complex-part-designator
shall be an array.
Further lines appear later in which in which substrings of array
sections are explicitly mentioned: eg.
If a substring-range appears in an array-section, each element is the
designated substring of the corresponding element of the array
section. The value of a subscript in an array element shall be within
the bounds for its dimension.
Thus the patch is contrary to the standard and must be removed as soon
as possible.
Paul