Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Flang] [OpenMP] Variables in common blocks may not be inheriting data sharing attributes #49545

Closed
sscalpone opened this issue May 2, 2021 · 3 comments · Fixed by #79017
Closed
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior bugzilla Issues migrated from bugzilla flang:frontend openmp

Comments

@sscalpone
Copy link
Contributor

Bugzilla Link 50201
Version trunk
OS All
CC @jeanPerier,@kiranktp,@sscalpone

Extended Description

The variable 'a' ought to inherit threadprivate from the common block.

% cat t.f90
integer(4) :: a
common /c/ a
!$OMP THREADPRIVATE(/c/)
!$OMP PARALLEL DEFAULT(none)
a = omp_get_thread_num()
!$OMP END PARALLEL
end

% flang -c -fopenmp t.f90
./t.f90:5:5: error: The DEFAULT(NONE) clause requires that 'a' must be listed in a data-sharing attribute clause
a = omp_get_thread_num()
^

@sscalpone
Copy link
Contributor Author

assigned to @kiranchandramohan

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@psteinfeld psteinfeld added the bug Indicates an unexpected problem or unintended behavior label Jun 6, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Jun 6, 2023

@llvm/issue-subscribers-bug

@llvmbot
Copy link
Collaborator

llvmbot commented Jun 7, 2023

@llvm/issue-subscribers-openmp

harishch4 added a commit that referenced this issue Jan 23, 2024
…es (#79017)

When a default(none) clause exists and a threadprivate variable is used
inside the construct, the variable does not inherit threadprivate
behavior and throws the below error.

> error: The DEFAULT(NONE) clause requires that 'a' must be listed in a
data-sharing attribute clause

Added a condition to skip the error if it is a threadprivate variable.

Fixes: #49545
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior bugzilla Issues migrated from bugzilla flang:frontend openmp
Projects
None yet
3 participants