https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96897 Bug 96897 depends on bug 37516, which changed state.
Bug 37516 Summary: ~(-2 - a) is not being optimized into a + 1 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37516 What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |DUPLICATE