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

            Bug ID: 95270
           Summary: OpenACC 'enter data attach(data_p)' fails for 'int
                    *data_p'
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: openacc
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org, jules at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48581
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48581&action=edit
'mdc-2b_.c'

See test case attached: 'acc_attach(&data_p)' works, '#pragma enter data
attach(data_p)' doesn't.

In such a case, I suppose we either need to explicitly set 'OMP_CLAUSE_SIZE' in
all front ends, or otherwise make sure to skip/invalidate the
'gcc/gimplify.c:gimplify_scan_omp_clauses' handling:

    if (OMP_CLAUSE_SIZE (c) == NULL_TREE)
      OMP_CLAUSE_SIZE (c) = DECL_P (decl) ? DECL_SIZE_UNIT (decl)
                            : TYPE_SIZE_UNIT (TREE_TYPE (decl));

..., or elsewhere?

Given that for 'GOMP_MAP_ATTACH' etc. this is a *bias*, not a *size*, I'd like
to see this explicitly mentioned/handled in the code, under the assumption that
for 'GOMP_MAP_STRUCT'-related 'GOMP_MAP_ATTACH', we do need this set non-zero. 
Also need to update the comments in 'include/gomp-constants.h:enum
gomp_map_kind' to explain that (see 'GOMP_MAP_POINTER' example?).

Reply via email to