https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115382
Bug ID: 115382 Summary: Wrong code with in-order conditional reduction and masked loops Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org Target Milestone: --- vectorize_fold_left_reduction does if (LOOP_VINFO_FULLY_MASKED_P (loop_vinfo)) mask = vect_get_loop_mask (loop_vinfo, gsi, masks, vec_num, vectype_in, i); else if (is_cond_op) mask = vec_opmask[i]; that doesn't work - both masks have to be combined. This for example shows in a runfail of gcc.dg/vect/vect-cond-reduc-in-order-2-signed-zero.c with -march=cascadelake --param vect-partial-vector-usage=2 on x86_64. The len-masking code looks good.