https://github.com/MattPD commented:
Verified against 1f5a312cb57d8c04f6039b0a594a20479b7e3ef2. Three pre-existing lowering defects (present at the base revision for `double` or `real(8)`) become reachable for `long double` or `real(10)` now that this PR avoids the alignment assertion. These may merit separate follow-up: - Under OpenMP 5.2, Flang `real(10)` `==` updates on `+0.0` versus `-0.0` and skips the update for NaNs with identical representations, because `createAtomicCompare` emits numeric `fcmp oeq` (`OMPIRBuilder.cpp:11864-11867`, via `flang/lib/Lower/OpenMP/Atomic.cpp:833-836` and `OpenMPToLLVMIRTranslation.cpp:6502,6943`) instead of applying OpenMP 5.2 §4.3.1.3 physical-representation equality. - In `emitOMPAtomicCompareExpr`, `EmitRValueWithCastIfNeeded` (`CGStmtOpenMP.cpp:7333-7344`) narrows a wider expected operand `e` to the type of `x`, so in OpenMP 5.2 mode comparing `long double` `x = 1.0L` against a distinct `__float128` value rounding to `1.0L` updates `x`, although the usual arithmetic conversions required by OpenMP 5.2 §4.3.1.3 make the comparison false. - In `emitOMPAtomicCompareExpr`, `CGF.EmitLValue(V)` (`CGStmtOpenMP.cpp:7361`) evaluates the fail-only capture destination lvalue `v` before the comparison, so evaluating the destination expression can have side effects even when the comparison succeeds and skips the store. https://github.com/llvm/llvm-project/pull/226567 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
