https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81850
Bug ID: 81850 Summary: OpenMP target enter data compilation issues Product: gcc Version: 7.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: thorstenkurth at me dot com Target Milestone: --- Created attachment 41990 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41990&action=edit Test case Dear Sir/Madam, g++ 7.1.1 cannot compile correct OpenMP 4.5 code. I have attached a small example program I initially developer to demonstrate a compiler bug for XLC. GCC throws the following error message on compilation: g++ -O2 -std=c++11 -fopenmp -foffload=nvptx-none -c aclass.cpp -o aclass.o In file included from aclass.h:2:0, from aclass.cpp:1: masterclass.h: In member function 'void master::allocate(const unsigned int&)': masterclass.h:10:50: error: 'master::data' is not a variable in 'map' clause #pragma omp target enter data map(alloc: data[0:size*sizeof(double)]) ^~~~ masterclass.h:10:9: error: '#pragma omp target enter data' must contain at least one 'map' clause #pragma omp target enter data map(alloc: data[0:size*sizeof(double)]) ^~~ masterclass.h: In member function 'void master::deallocate()': masterclass.h:15:51: error: 'master::data' is not a variable in 'map' clause #pragma omp target exit data map(release: data[:0]) ^~~~ masterclass.h:15:9: error: '#pragma omp target exit data' must contain at least one 'map' clause #pragma omp target exit data map(always, release: data[:0]) To me it seems that it cannot recognize the "alloc" clause. Best Regards Thorsten Kurth