https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121737
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Target| |aarch64, x86-64-*-*
Last reconfirmed| |2025-09-01
Ever confirmed|0 |1
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot
gnu.org
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note this might be because of
<bb 5> [local count: 939524096]:
# i_34 = PHI <i_22(8), 1(7)>
# rngx$0_35 = PHI <_28(8), _1(7)>
# rngx$1_37 = PHI <_10(8), _1(7)>
# rngy$0_39 = PHI <_8(8), _2(7)>
# rngy$1_41 = PHI <_19(8), _2(7)>
_3 = poly_13(D)->v[i_34].x;
_11 = _3 < rngx$0_35;
_28 = _11 ? _3 : rngx$0_35;
_9 = _3 > rngx$1_37;
_10 = _9 ? _3 : rngx$1_37;
_4 = poly_13(D)->v[i_34].y;
_27 = _4 < rngy$0_39;
_8 = _27 ? _4 : rngy$0_39;
_20 = _4 > rngy$1_41;
_19 = _20 ? _4 : rngy$1_41;
i_22 = i_34 + 1;
if (len_14 > i_22)
goto <bb 8>; [87.50%]
we have mixed <, > in the COND_EXPRs, and they didn't get if-converted
to MAX/MIN w/o fast-math, but reduction detection will not handle the
above form because of the multi-uses of the reduction variable:
t.c:31:17: note: Analyze phi: rngy$1_41 = PHI <_19(8), _2(7)>
t.c:31:17: missed: reduction used in loop.
t.c:31:17: missed: Unknown def-use cycle pattern.
t.c:31:17: note: Analyze phi: rngy$0_39 = PHI <_8(8), _2(7)>
t.c:31:17: missed: reduction used in loop.
t.c:31:17: missed: Unknown def-use cycle pattern.
t.c:31:17: note: Analyze phi: rngx$1_37 = PHI <_10(8), _1(7)>
t.c:31:17: missed: reduction used in loop.
t.c:31:17: missed: Unknown def-use cycle pattern.
t.c:31:17: note: Analyze phi: rngx$0_35 = PHI <_28(8), _1(7)>
t.c:31:17: missed: reduction used in loop.
t.c:31:17: missed: Unknown def-use cycle pattern.
I think we can enhance reduction detection to handle this specific
multi-use case.