File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -2119,7 +2119,7 @@ void OmpAttributeVisitor::Post(const parser::OpenMPAllocatorsConstruct &x) {
2119
2119
2120
2120
static bool IsPrivatizable (const Symbol *sym) {
2121
2121
auto *misc{sym->detailsIf <MiscDetails>()};
2122
- return !IsProcedure (*sym) && !IsNamedConstant (*sym) &&
2122
+ return IsVariableName (*sym) && !IsProcedure (*sym) && !IsNamedConstant (*sym) &&
2123
2123
!semantics::IsAssumedSizeArray (
2124
2124
*sym) && /* OpenMP 5.2, 5.1.1: Assumed-size arrays are shared*/
2125
2125
!sym->owner ().IsDerivedType () &&
Original file line number Diff line number Diff line change
1
+ ! RUN: %flang_fc1 -fopenmp -fdebug-dump-symbols %s | FileCheck %s
2
+ ! Test that we do not make a private copy of the critical name
3
+
4
+ ! CHECK: MainProgram scope: mn
5
+ ! CHECK-NEXT: j size=4 offset=0: ObjectEntity type: INTEGER(4)
6
+ ! CHECK-NEXT: OtherConstruct scope:
7
+ ! CHECK-NEXT: j (OmpPrivate): HostAssoc
8
+ ! CHECK-NEXT: k2 (OmpCriticalLock): Unknown
9
+ program mn
10
+ integer :: j
11
+ j= 2
12
+ ! $omp parallel default(private)
13
+ ! $omp critical(k2)
14
+ j= 200
15
+ ! $omp end critical(k2)
16
+ ! $omp end parallel
17
+ end
You can’t perform that action at this time.
0 commit comments