https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38209
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |12.0 Status|ASSIGNED |RESOLVED Known to work| |12.1.0 Resolution|--- |FIXED --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Fixed for GCC 12 by r12-5699-gde3e5aae6c4b540e8 Specifically this part: X != C1 ? ~X : C2 simplifies to ~X when ~C1 == C2. which is the BIT_NOT_EXPR analog of the NEGATE_EXPR case.