[flang-commits] [flang] [flang][runtime] Enable more APIs in the offload build. (PR #76486)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Thu Dec 28 10:02:57 PST 2023


================
@@ -83,8 +89,11 @@ static inline CppTypeFor<RCAT, RKIND> DoDotProduct(
       AccumType accum{};
       if constexpr (RCAT == TypeCategory::Complex) {
         for (SubscriptValue j{0}; j < n; ++j) {
-          accum += std::conj(static_cast<AccumType>(*xp++)) *
+          // std::conj() may instantiate its argument twice,
----------------
vzakhari wrote:

The issue shows up as a warning `multiple unsequenced modifications to 'xp'`, when compiling the runtime as OpenMP offload with clang.  I think it might be a bug in clang, because `std::conj` is not a macro.  I can change the comment to something like `avoid spurious warning when compiling with clang` to avoid the confusion about multiple instantiation of the argument.

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


More information about the flang-commits mailing list