https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89433
Bug ID: 89433
Summary: Repeated use of the OpenACC 'routine' directive
Product: gcc
Version: 9.0
Status: UNCONFIRMED
Keywords: openacc
Severity: normal
Priority: P3
Component: c
Assignee: tschwinge at gcc dot gnu.org
Reporter: tschwinge at gcc dot gnu.org
Depends on: 72741
Target Milestone: ---
We found that it's not correct that we currently unconditionally diagnose an
error for repeated use of the OpenACC 'routine' directive on one
function/declaration. (For reference, it is also permissible for an "ordinary"
function to have several declarations plus a definition, as long as these are
compatible.) This is, the following shall be valid:
#pragma acc routine worker
void f(void)
{
}
#pragma acc routine (f) worker
#pragma acc routine worker
extern void f(void);
Within one translation unit, we just remove the existing diagnostic, and
declare it user error if any two usages are not compatible, but in that case we
try to be helpful, and produce a compile-time diagnostic. For incompatible use
spanning over multiple translation units, it will be more difficult to produce
meaningful diagnostics/semantics.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72741
[Bug 72741] Fortran OpenACC routine directive doesn't properly handle clauses
specifying the level of parallelism