https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108979
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|rguenth at gcc dot gnu.org |unassigned at gcc dot gnu.org CC| |rsandifo at gcc dot gnu.org Status|ASSIGNED |NEW --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Error: definition in block 4 does not dominate use in block 6 for SSA_NAME: loop_mask_16 in statement: vect__33.10_19 = .COND_MUL (loop_mask_16, _1, _4, _1); that stmt ended up in the preheader. That happens when scheduling t.f90:4:26: note: node 0x3c6a870 (max_nunits=4, refcnt=1) vector([4,4]) real(kind=4) t.f90:4:26: note: op template: _33 = tmp_17(D) * p_bd_18(D); t.f90:4:26: note: stmt 0 _33 = tmp_17(D) * p_bd_18(D); t.f90:4:26: note: stmt 1 _33 = tmp_17(D) * p_bd_18(D); t.f90:4:26: note: children 0x3c6a900 0x3c6a990 because as can be seen, the operands are all loop invariant and we are appearantly not honoring the implicit dependence on a mask (those are not added as implicit operand to the SLP graph - something we eventually would want to do). Now - it's also completely unnecessary to mask this statement, and _that's_ possibly the easier way out here. Instead of -fnon-call-exceptions one can also use -fno-tree-loop-im to keep the invariant computation inside the loop and trigger the same ICE. Richard - you are more familiar with loop masking - where do we decide whether a stmt needs masking and couldn't we easily decide it doesn't need if all operand dt are external or invariant?