Sandra Loosemore wrote:
As noted in PR 118965, the initial interop implementation overlooked
the requirement in the OpenMP spec that at least one of the "target"
and "targetsync" modifiers is required in both the interop construct
init clause and the declare variant append_args clause.

... which is not surprising with OpenMP 5.2/6.0 syntax,
which makes it easier to miss.

Additionally, some useful properties are always available
and not only when target or targetsync has been specified,
i.e. from the technical/semantic side, there is no need
for requiring target and/or target sync.

But as the spec does so, it makes sense to modify GCC to require it
and doing so has advantages related to parsing and
diagnostic. (See below.)

[BTW: In GCC, for all currently supported foreign runtimes,
there is no overhead for making all 'target' properties
available; hence, 'target' has no effect on the runtime
side.]

* * *

Adding the check was fairly straightforward, but it broke about a
gazillion existing test cases.
Thanks for going though all of them and updating them!

Since one of the effects of the change is that at least one
modifier is always required, I found that deleting all the code that was
trying to detect and handle the no-modifier case allowed for better
diagnostics.

Yes, that makes both the code and the diagnostic better.

* * *

LGTM.

Thanks for the patch!

Tobias

Reply via email to