[flang-commits] [flang] [flang][OpenMP] Don't allow namelist variables with threadprivate (PR #130957)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Tue Mar 18 10:26:12 PDT 2025


tblah wrote:

> If it is not in the standard, could you comment on what other compilers (gfortran, ifx, nvfortran/armflang) do? You can use godbolt for it.

Using the original fujitsu test (see https://github.com/llvm/llvm-project/issues/112538), nvfortran complains that nam1 and nam2 are not threadprivate (they are inside of a threadprivate common block so I don't think that is correct). GFortran does compile it (and produces a correct result). ifx and ifort also allow the code.

> The function you are making this change is called `CheckThreadprivateOrDeclareTargetVar`. So is this for DeclareTargetVar as well? If so, could you add a test?
That wasn't intentional. I imagine namelists wouldn't work with anything on the target device but I don't know enough to be sure so I will restrict this to only threadprivate for now.

I'm still unsure why CI is failing and I can't reproduce the failure on my machine. Hopefully it will fix after I push a change. :crossed_fingers: 


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


More information about the flang-commits mailing list