[flang][openacc] Fix false error when common block is in copy clause
authorValentin Clement <clementval@gmail.com>
Wed, 5 Jul 2023 15:33:54 +0000 (08:33 -0700)
committerValentin Clement <clementval@gmail.com>
Wed, 5 Jul 2023 15:34:22 +0000 (08:34 -0700)
Wrong error was reported mentioning that the common block was in
more than one data sharing clause.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D154393

flang/include/flang/Semantics/symbol.h
flang/lib/Semantics/resolve-directives.cpp
flang/test/Semantics/OpenACC/acc-resolve04.f90

index 2fb4594..1651e68 100644 (file)
@@ -594,7 +594,7 @@ public:
       // OpenACC data-sharing attribute
       AccPrivate, AccFirstPrivate, AccShared,
       // OpenACC data-mapping attribute
-      AccCopyIn, AccCopyOut, AccCreate, AccDelete, AccPresent,
+      AccCopy, AccCopyIn, AccCopyOut, AccCreate, AccDelete, AccPresent,
       // OpenACC data-movement attribute
       AccDevice, AccHost, AccSelf,
       // OpenACC miscellaneous flags
index 70b8111..3692a4f 100644 (file)
@@ -156,8 +156,7 @@ public:
   bool Pre(const parser::AccClause::Detach &);
 
   bool Pre(const parser::AccClause::Copy &x) {
-    ResolveAccObjectList(x.v, Symbol::Flag::AccCopyIn);
-    ResolveAccObjectList(x.v, Symbol::Flag::AccCopyOut);
+    ResolveAccObjectList(x.v, Symbol::Flag::AccCopy);
     return false;
   }
 
index d02b19e..ee5e21a 100644 (file)
@@ -12,5 +12,8 @@ program test_resolve04
 !$acc update self(/foo/)
 !$acc end data
 
+!$acc data copy(/foo/)
+!$acc end data
+
 end