https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58195
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #5) > Mine, After PR 25290, the below match.pd pattern will just work :). > > (In reply to Marc Glisse from comment #3) > > and something that could be auto-generated from a pattern like: > > (cond (ne @0 0) (negate @0) 0) -> (negate @0) Actually that was implemented with r12-2041. It is just the loop that is left. We do get the optimization if we use -fwrapv :). I will handle the loop one for GCC 13.