[Flang][OpenMP] Undetected error for conflicting OpenMP data-sharing on common block and member
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Flang does not diagnose conflicting OpenMP data-sharing clauses when a named common block and one of its members are listed on the same directive. Per the OpenMP spec, listing a common block is equivalent to listing all its members, so this should be rejected.
Expected Behavior: Compilation error, e.g. 'X' appears in more than one data-sharing clause on the same OpenMP directive.
Actual Behavior: Compilation succeeds with no diagnostic.
Reproducer:
```Fortran
SUBROUTINE COMMON_WRONG()
COMMON /C/ X,Y
! Incorrect because X is a constituent element of C
!$OMP PARALLEL PRIVATE(/C/), SHARED(X)
!$OMP END PARALLEL
END SUBROUTINE COMMON_WRONG
```
Contributor guide
Research direction
No source file or test path is named. Start by compiling the provided Fortran reproducer with Flang and trace its OpenMP semantic analysis for conflicting data-sharing clauses; done means the directive is rejected with a diagnostic that identifies the conflicting common-block member.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fortran
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100