[flang-commits] [flang] [flang][OpenMP] don't privatise loop index marked shared (PR #108176)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Wed Sep 11 11:30:12 PDT 2024


luporl wrote:

> ```
> Loop iteration variables of loops that are not associated with any OpenMP directive maybe listed in data-sharing attribute clauses on the surrounding teams, parallel or taskgenerating construct, and on enclosed constructs, subject to other restrictions.
> ```

My understanding is that this is one of the exceptions mentioned in the standard, where the data-sharing attribute (DSA) clause overrides the predetermined DSA:

```
Variables with predetermined data-sharing attributes may not be listed in data-sharing attribute clauses, except for the cases listed below. For these exceptions only, listing a predetermined variable in a data-sharing attribute clause is allowed and overrides the variable’s predetermined data-sharing attributes.
```

Besides gfortran, ifort and ifx also have this behavior.

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


More information about the flang-commits mailing list