[flang-commits] [flang] [flang][OpenMP] Catch threadprivate common block vars that appear in equivalence (PR #127642)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Fri Feb 21 08:50:25 PST 2025


kiranchandramohan wrote:

I think @luporl is basing the change of this PR on the following points from the standard. 

```
Page 61 : OpenMP 5.2

11 When a named common block appears in an OpenMP argument list, it has the same meaning and
12 restrictions as if every explicit member of the common block appeared in the list. An explicit
13 member of a common block is a variable that is named in a COMMON statement that specifies the
14 common block name and is declared in the same scoping unit in which the clause appears.

Page 105 : OpenMP 5.2

8 A variable may only appear as an argument in a threadprivate directive in the scope in
9 which it is declared. It must not be an element of a common block or appear in an
10 EQUIVALENCE statement.
```

I see that gfortran also adopts this interpretation. But ifx and classic flang/nvfortran do not and allow the usage in https://github.com/fujitsu/compiler-test-suite/blob/main/Fortran/0685/0685_0007.f90
@kkwli @mjklemm Any opinion here?



https://github.com/llvm/llvm-project/pull/127642


More information about the flang-commits mailing list