[flang-commits] [flang] [flang][HLFIR] Fix crash in WHERE with exactly_once inside elemental (PR #194443)
via flang-commits
flang-commits at lists.llvm.org
Tue Apr 28 09:13:37 PDT 2026
jeanPerier wrote:
> With this, it seems that the problem is shifting and the original Fortran code now gives an error along these lines:
Thanks for testing, ok, this makes sense, the pass that is lowering hlfir.where is not expecting to find hlfir.exactly_once in the mask expression of top level where because this is not an expression whose evaluation is masked from a standard point of view, so it is just cloning it.
So the real fix should be the alternative I mentioned which is to improve the detection to actually not consider that anything inside the top level mask region should be masked (which currently happens as soon as the context is in a sub region of the first mask).
If something like [this](https://github.com/llvm/llvm-project/commit/0d1e222e4872f9b4786b70f6464f3f276151bd21) works for your original code, feel free to take it.
https://github.com/llvm/llvm-project/pull/194443
More information about the flang-commits
mailing list