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

            Bug ID: 118741
           Summary: [OpenMP] metadirectives for declarative use rejected
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Keywords: openmp, rejects-valid
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                CC: sandra at gcc dot gnu.org
  Target Milestone: ---

Probably not the highest priority but the following could be useful -
especially with 'device' to handle certain host or offload devices:

----------------
int f()
{
  int x, y;
  #pragma omp metadirective \
         when(user={condition(1)} : allocate(x) align(128)) \
         otherwise(nothing)
  x = 5
  y = x;
  return y;
}
----------------

sorry, unimplemented: declarative directive variants of a ‘metadirective’ are
not supported
    4 |   #pragma omp metadirective when(user={condition(1)} : allocate(x)
align(128)) otherwise(nothing)
      |                                                        ^~~~~~~~

* * *

Likewise for Fortran:
  subroutine f
    integer :: x
    !$omp metadirective &
    !$omp&    when(user={condition(.true.)} : allocate(x) align(128))
    !$omp&    otherwise(nothing)
    x = 5
 end

f951: sorry, unimplemented: declarative directive variants are not supported

(See PR118740 for the missing location in the diagnostic.)

* * *

The problem is that GCC handles those via attributes, inserted during parsing,
and processes them during gimplify – while at least for 'device' the solution
would happen very late.

Reply via email to