[flang-commits] [flang] 85128d8 - [flang][openacc] Fix false error when common block is in copy clause

Valentin Clement via flang-commits flang-commits at lists.llvm.org
Wed Jul 5 08:34:28 PDT 2023


Author: Valentin Clement
Date: 2023-07-05T08:34:22-07:00
New Revision: 85128d8b6aba0e471a4eec18ca30375b17c61345

URL: https://github.com/llvm/llvm-project/commit/85128d8b6aba0e471a4eec18ca30375b17c61345
DIFF: https://github.com/llvm/llvm-project/commit/85128d8b6aba0e471a4eec18ca30375b17c61345.diff

LOG: [flang][openacc] Fix false error when common block is in copy clause

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Semantics/symbol.h b/flang/include/flang/Semantics/symbol.h
index 2fb45942baf6ff..1651e68879b56f 100644
--- a/flang/include/flang/Semantics/symbol.h
+++ b/flang/include/flang/Semantics/symbol.h
@@ -594,7 +594,7 @@ class Symbol {
       // 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

diff  --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 70b81117b5c8b1..3692a4fcd87588 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -156,8 +156,7 @@ class AccAttributeVisitor : DirectiveAttributeVisitor<llvm::acc::Directive> {
   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;
   }
 

diff  --git a/flang/test/Semantics/OpenACC/acc-resolve04.f90 b/flang/test/Semantics/OpenACC/acc-resolve04.f90
index d02b19e3bede6d..ee5e21adcb5e8c 100644
--- a/flang/test/Semantics/OpenACC/acc-resolve04.f90
+++ b/flang/test/Semantics/OpenACC/acc-resolve04.f90
@@ -12,5 +12,8 @@ program test_resolve04
 !$acc update self(/foo/)
 !$acc end data
 
+!$acc data copy(/foo/)
+!$acc end data
+
 end
 


        


More information about the flang-commits mailing list