[PATCH, v2] Fortran: fix invalid rank error in ASSOCIATED when rank is remapped [PR77652]

Mikael Morin morin-mikael@orange.fr
Thu Jul 28 20:19:40 GMT 2022


Hello,

Le 27/07/2022 à 21:45, Harald Anlauf via Fortran a écrit :
> ok, I have thought about your comments in the review process,
> and played with the Cray compiler.  Attached is a refined version
> of the patch that now rejects in addition these cases for which there
> are no possible related pointer assignments with bounds remapping:
> 
>    ASSOCIATED (scalar, array) ! impossible, cannot remap bounds
>    ASSOCIATED (array, scalar) ! a scalar is not simply contiguous
> 
In principle, it could make sense to construct a one-sized array pointer 
(of any rank) pointing to a scalar, but I agree that if we follow the 
rules of the standard to the letter, it should be rejected (and we do 
reject such a pointer assignment).
So, with this case eliminated, this patch looks good to me as is.

Regarding Toon’s suggestion to ask the fortran committee, it sounds 
sensible.  I propose to prepare something tomorrow.





More information about the Fortran mailing list