https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119096
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #2) > The vectorizer looks ok though: > mask_patt_37.15_52 = [vec_unpack_lo_expr] mask__9.14_51; > mask_patt_37.15_53 = [vec_unpack_hi_expr] mask__9.14_51; > vect_patt_36.18_57 = .COND_ADD (mask_patt_37.15_52, vect__10.16_54, > vect_total_21.17_56, vect__10.16_54); > vect_patt_36.18_58 = .COND_ADD (mask_patt_37.15_53, vect__10.16_55, > vect_patt_36.18_57, vect__10.16_55); > > > /* A ? B : B -> B. */ > (simplify > (cnd @0 @1 @1) > @1) > > Confirmed, I think COND_ADD folding goes wrong. Wait maybe the original COND_ADD is incorrect. I can't remember how COND_ADD works. I thought it was `mask_patt_37.15_52 ? (vect__10.16_54+vect_total_21.17_56) : vect__10.16_54` if so then the original COND_ADD is wrong.