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

            Bug ID: 96112
           Summary: [OpenACC] 'acc_is_present' if 'byte length is zero'
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: openacc
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: ams at gcc dot gnu.org, jakub at gcc dot gnu.org
  Target Milestone: ---

Ever since OpenACC 2.0a (the first we implemented), 3.2.29 "acc_is_present"
states that "If the byte length is zero, the function returns ['true'] if the
given address is present at all on the device".  We return 'false'.

This especially should then also do the right thing for a testcase involving a
"zero-length array section" (OpenMP terminology); untested:

    int n = 0;
    int a[n];
    #pragma acc data create(a[0:n])
      {
        assert(acc_is_present(a, 0));
      }

Reply via email to