https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114545
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2026-02-13
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think there's a duplicate about this issue. We have in the end
a.0_1 = a;
c.1_2 = c;
_3 = a.0_1 - c.1_2;
b = _3;
_4 = c.1_2 - a.0_1;
a = _4;
and IIRC there's a PR where I attached a patch to make VN replace _4
with _4 = -_3; but this might be quickly propagated out again and
as andrew says on modern uarchs is likely slower (but then with GIMPLE
metrics it's better).
The regression is probably since we do this kind of folding on GIMPLE
(the -(-a + c) -> a - c one).