Hi, This is a fix for PR96757. Before vect pass, the main statements of the test case will be optimized likeļ¼š _1 = d_10(D) > 3; _2 = a_11(D) > m_12(D); _18 = _1 > _2 ? _26 : 0; At the beginning of vectorization analysis, function vect_recog_mask_conversion_pattern processed the gimple _18 = _1 > _2 ? _15 : 0, and produce: patt_17 = _1 > _2 patt_3 = patt_17 ? _15 : 0 it didn't consider the situation that _1, _2's vectype is different, which leading to an ICE in some special mode , like V4HImode for this case. This patch added the identification and handling for this situation in vect_recog_mask_conversion_pattern. With that _18 = _1 > _2 ? _15 : 0 will be transformed to: patt_3 = () _2; patt_17 = _1 > patt_3; patt_20 = patt_17 ? _26 : 0; More details in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96757. Bootstrap and tested on both aarch64 and x86 Linux platform, no new regression witnessed. Ok for trunk? Thanks, Duan Bo