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

Mikael Morin morin-mikael@orange.fr
Mon Jul 25 10:43:25 GMT 2022

Le 21/07/2022 à 22:12, Harald Anlauf via Fortran a écrit :
> Dear all,
> the rank check for ASSOCIATED (POINTER, TARGET) did not allow all
> rank combinations that were allowed in pointer assignment for
> newer versions of the Fortran standard (F2008+).  Fix the logic.
So, if I understand correctly the (fixed) logic, it is:
  f2008+    => no check
  f2003     => check target’s rank different from 1
  up to f95 => check pointer’s rank equals target’s

I think one check is missing, that is when pointer is scalar and the 
target is non-scalar (either rank 1 or not).  This case should also be 
rejected for f2003+, not just up to f95.


More information about the Gcc-patches mailing list