https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126887
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot
gnu.org
Last reconfirmed| |2026-08-17
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
We hit
if (e->flags & EDGE_ABNORMAL
// This is like path_crosses_loops in profitable_path_p but
// more restrictive to avoid peeling off loop iterations (see
// tree-ssa/pr14341.c for an example).
// ??? Note this restriction only applied when visiting an
// interesting PHI with the former resolve_phi.
|| (!interesting_phis.is_empty ()
&& m_path[0]->loop_father != e->src->loop_father))
continue;
in find_paths_to_names. I guess we might want to defer this check and
only disallow when the path exit condition resolves to not exiting the
loop. That is, the above tries to prevent peeling the first iteration
for the case the exit test would be, say, i != 8 when the condition
would resolve to know to stay inside the loop. The above point of
rejection is premature.
I suppose for policy rejection (rather than profitability rejection)
m_registry.register_path would be responsible. But maybe there's a similar
enough check in the profitable_path_p that could be enhanced.
Let me give it a stab.