[flang-commits] [flang] [flang][OpenMP] Detect conflicting data-sharing clauses for common blocks (PR #213913)

via flang-commits flang-commits at lists.llvm.org
Thu Sep 3 23:43:22 PDT 2026


ejose02 wrote:

> > Per-member CheckMultipleAppearances calls would miss the fp/lp exception: for firstprivate(j) lastprivate(/com/), the symbol created for member j when processing lastprivate is a new object and doesn't carry OmpFirstPrivate, so the exception check symbol.test(OmpFirstPrivate) fails. FindObjectWithDSAByUltimate looks up the earlier clause's flag by matching on the ultimate symbol and passes it as prevFlag to make the exception work.
> 
> `ResolveOmp` won't create a new symbol if it's already in the current scope, so in that case `OmpFirstPrivate` should be present on the resolved common block member `resolvedObject`.

You’re right. ResolveOmp reuses the in-scope symbol, so OmpFirstPrivate is already on resolvedObject. I now pass that into WithMultipleAppearancesOmpException and dropped prevFlag / FindObjectWithDSAByUltimate.

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


More information about the flang-commits mailing list