https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110989
--- Comment #2 from JuzheZhong <juzhe.zhong at rivai dot ai> --- Confirm it's caused by: if (!final_len) { /* Pass VF value to 'len' argument of MASK_LEN_LOAD if LOOP_LENS is invalid. */ tree iv_type = LOOP_VINFO_RGROUP_IV_TYPE (loop_vinfo); final_len = build_int_cst (iv_type, TYPE_VECTOR_SUBPARTS (vectype)); } The final_len is false when we didn't record len. In this situation, LOOP_VINFO_RGROUP_IV_TYPE (loop_vinfo) is not set correctly. Thanks for reporting.