https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101617
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Thinking about this some more, there is a canonicalization issue. We need to decide if we want to canonicalization to just a ? -1 : 1; or expand it out. a ? 1 : 0 makes sense to do (cast) a; So does "a ? 0 : 1". Does the current a ? -1 : 0 make sense or just add that to ifcvt. I am going to take a few days to think of this and such. There are other issues that deal with this. Even having a cmov existing makes it harder to decide. Even though for an example -(a == 0) can be optimized nicely on x86, it might not be nicely on other targets.