https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112117
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-10-30 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. Peeling a single iteration might look like the easiest way here, the trick is to see we can then eliminate an add and a PHI node in the loop. Note with the current pass ordering this would come quite late since the required store-motion is performed only before PRE. It could also be seen as hoisting opportunity, transforming # a_lsm.7_16 = PHI <c.0_1(3), a_lsm.7_6(2)> _3 = c.0_1 + a_lsm.7_16; into tem1 = c.0_1 + c.0_1; tem2 = c.0_1 + a_lsm.7_6; # _3 = PHI <tem1(3), tem2(2)> but the rest wouldn't reduce as nicely to a multiplication then.