https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112627
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-11-20 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- note that we can't optimize it to a - b == 0 because a - b might overflow while (a + c) - b might not. Likewise (a + c) + b == c cannot be optimized to a == -b because -b might overflow (but maybe to a == (int)-(unsigned)b). Clever arguments might be possible to rule out some overflows based on the original expression.