https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104595
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- bool patterns are to distinguish flag uses from data uses since a vectorized flag true will be -1 while the unvectorized flag is 1 but of course any data uses have to be retained. What we are missing here is the reverse, convert unvectorized flag 1 to vectorized flag -1 for data. Since there may be data and non-data uses we have to insert fixups (patterns) at use sites. For the bool vs. char case that's the iftmp.0_3 = _1 ? iftmp.0_7 : iftmp.0_6; case. Since we generally assume a bool LHS will be vectorized to a mask we don't do our job here since obviously bool loads do not. Conversions do not either and the code to handle those is a bit awkward as well, handling bool source and bool destination differently for some reason (but not both at the same time?). This all needs a bit of dis-entangling and probably re-ordering of vect_recog_bool_pattern and vect_recog_mask_conversion_pattern.