[flang-commits] [flang] [Flang][OpenMP] Fix crash and IR errors for user-defined reduction on allocatable variables (PR #186765)

via flang-commits flang-commits at lists.llvm.org
Thu Jul 2 00:53:28 PDT 2026


================
@@ -0,0 +1,117 @@
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=45 %s -o - | FileCheck %s
----------------
MattPD wrote:

This test cannot catch either initializer issue I flagged, nor a runtime regression. It checks IR only, for the integer case with a constant initializer, single-variable clauses, and default lower bounds. Could you add an execution test mirroring the issue (the combined `reduction(foo : a, b, c)` clause with `b(6:9)`/`c(3,8:9)` and the `if (...) stop 1` check), plus a `real` allocatable case and an `omp_priv = omp_orig` case, which currently crash and silently zero-initialize? A character case would also lock in the char path, which does work today.

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


More information about the flang-commits mailing list