https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110986
--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 55728 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55728&action=edit Fixes part of this This patch does 2 things which I will split out. First is it creates COND_NOT like COND_NEG to allow better code generation earlier on. Next it simplifies: vector `(a ? -1 : 0) ^ b` -> `a ? ~b : b` as there might be a conditional not. That fixes the case where the types are the same. Still need to fix up the case where the types are different.