Bug 110033 - rejects-valid: associate name corresponding to coarray selector should be considered a coarray
Summary: rejects-valid: associate name corresponding to coarray selector should be con...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 13.1.0
: P4 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: associate
  Show dependency treegraph
 
Reported: 2023-05-30 03:42 UTC by Neil Carlson
Modified: 2023-06-17 16:54 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2023-06-02 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Carlson 2023-05-30 03:42:27 UTC
In the following example, the associate name Y corresponds to a coarray. According to 11.1.3.3 par. 2 (f2018), Y should be regarded as a coarray, however gfortran rejects this as invalid.

real :: x[*]
associate (y => x)
  y[1] = 1.0
end associate
end

gfortran -fcoarray=lib gfortran-20230529.f90 
gfortran-20230529.f90:18:4:

   18 |   y[1] = 1.0
      |    1
Error: Coarray designator at (1) but ‘y’ is not a coarray
Comment 1 Neil Carlson 2023-05-30 03:44:07 UTC
This must be related to PR78152
Comment 2 kargls 2023-06-02 17:57:30 UTC
Confirmed.

There is a check for F2023:C1103

C1103 (R1105) variable shall not be a coindexed object.

but that applies to something like 'associate(y => x[1])'.

gfortran needs to check that if 'x' in 'associate(y => x)'
is a coarray, that its codimension and corank are propagated to
'y'.
Comment 3 Paul Thomas 2023-06-17 16:54:37 UTC
I'm onto it :-)

Paul