Hi Andre,
Am 12.08.24 um 14:11 schrieb Andre Vehreschild:
Hi all,
the attached two patches fix ASSOCIATE for coarrays, i.e. that a coarray
associated to a variable is also a coarray in the block of the ASSOCIATE
command. The patch has two parts:
1. pr110033p1_1.patch: Adds a corank member to the gfc_expr structure. I
decided to add it here and keep track of the corank of an expression, because
calling gfc_get_corank was getting to expensive with the associate patch. This
patch also improves the usage of coarrays in select type/rank constructs.
2. pr110033p2_1.patch: The changes and testcase for PR 110033. In essence the
coarray is not detected correctly on the expression to associate to and
therefore not propagated correctly into the block of the ASSOCIATE command. The
patch adds correct treatment for propagating the coarray token into the block,
too.
The costs of tracking the corank along side to the rank of an expression are
about 30 seconds real user time (i.e. time's "real" row) on a rather old Intel
i7-5775C@3.3GHz with 24G RAM that was used for work during the test. If need be
I can tuned that more.
Regtests ok on x86_64-pc-linux-gnu / Fedora 39. Ok for mainline?
Paul already gave a basic OK, and I won't object.
However, the testcase should be fixed. It is only correct for
single-image runs! (Verified with Intel ifx).
You have:
associate (y => x)
y = -1
y[1] = 35
end associate
and check:
if (x /= 35) stop 1
This should rather be
if (x[1] /= 35) stop 1
or for number of images > 1:
if (this_image() == 1) then
if (x /= 35) stop 1
else
if (x /= -1) stop 99
end if
and similarly
if (.NOT. c%l) stop 3
needs to be adjusted accordingly.
Thanks,
Harald
Regards,
Andre
--
Andre Vehreschild * Email: vehre ad gmx dot de