[flang-commits] [flang] [flang][OpenMP] fix lastprivate for allocatables (PR #99686)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Mon Jul 22 04:24:49 PDT 2024
tblah wrote:
> > realloc_lhs
>
> In later work, we should investigate whether this is needed.
I presume you mean `temporary_lhs`. This is tricky - the `lhs` of the assignment is not a temporary so it is a missuse of the flag. I originally included it because the documentation for `hlfir.assign` says that it prevents finalization of the lhs or lhs subobjects. However, when I tried more testcases it turned out this prevented arrays of different lengths from being assigned. This seems to contradict the documentation for `realloc`, but I wanted to get this landed before the branch if possible.
Now that I am looking closer, it isn't clear to me whether calling the finalization would actually be a bug. The OpenMP 5.2 standard (section 5.4.5) says the update should occur as though by intrinsic assignment (which I believe would run finalization). But I might have missed something, because the finalization would have already run inside each thread when the private copy was overwritten.
https://github.com/llvm/llvm-project/pull/99686
More information about the flang-commits
mailing list