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

            Bug ID: 126248
           Summary: OpenACC] 'copyout' allowed modifiers alwaysin vs
                    alwaysout
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhonghao at pku dot org.cn
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

There is a typo in the official OpenACC standard document. Here is the code:

int main() {
    int a[100];
    // According to the corrected standard intent, 'alwaysout' should be valid
for 'copyout'
    #pragma acc parallel copyout(alwaysout: a[0:100])
    {
        a[0] = 1;
    }
    return 0;
}

The latest GCC reports an error: 

<source>: In function 'int main()':
<source>:4:43: error: found ':' in nested-name-specifier, expected '::'
    4 |     #pragma acc parallel copyout(alwaysout: a[0:100])
      |                                           ^
      |                                           ::
<source>:4:34: error: 'alwaysout' has not been declared
    4 |     #pragma acc parallel copyout(alwaysout: a[0:100])
      |                                  ^~~~~~~~~
<source>:4:34: error: '<expression error>::a' has not been declared
<source>:4:46: error: expected ')' before '[' token
    4 |     #pragma acc parallel copyout(alwaysout: a[0:100])
      |                                              ^
      |                                              )
Compiler returned: 1



An LLVM developer discovered the logical inconsistency and discussed it with
the OpenACC mailing list. They confirmed it was a standardization error and had
fixed this bug:

https://github.com/llvm/llvm-project/commit/0a2b6f6c1cc796bcac38d1c6b44d76de6049ea12

Reply via email to