https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95293

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Time to dig out the F2018 standard...

15.5.2.4 Ordinary dummy variables

9 If the dummy argument has the TARGET attribute

That's fulfilled

does not have the VALUE attribute,

That's fulfilled.

and either the effective argument is simply contiguous

That's fulfilled.

or the dummy argument is scalar, assumed-rank, or assumed-shape, and does not
have the CONTIGUOUS attribute,

That is not relevant here.

and the effective argument has the TARGET attribute 

That I will have to look up; if a has the TARGET attribute,
does a%b have it as well?

but is not a coindexed
object or an array section with a vector subscript

That's fullfilled.

then

any pointers associated with the effective argument become associated with the
orresponding dummy argument on invocation of the procedure, and

Not relevant to your test case.

when execution of the procedure completes, any pointers that do not become
undefined (19.5.2.5) and are associated with the dummy argument remain
associated with the effective argument.

Hm, this indicates that your test case may be valid if the condition
abouve is met.  Have to look at the definition of the TARGET attribute next...

Reply via email to