https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98526

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 49937
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49937&action=edit
patch

Sth like this.  But I'm somewhat confused about the partial vector code in the
"else" branch:

  /* All but single defuse-cycle optimized, lane-reducing and fold-left
     reductions go through their own vectorizable_* routines.  */
  if (!single_defuse_cycle
      && code != DOT_PROD_EXPR
      && code != WIDEN_SUM_EXPR
      && code != SAD_EXPR
      && reduction_type != FOLD_LEFT_REDUCTION)
    {
      stmt_vec_info tem
        = vect_stmt_to_vectorize (STMT_VINFO_REDUC_DEF (phi_info));
      if (slp_node && REDUC_GROUP_FIRST_ELEMENT (tem))
        {
          gcc_assert (!REDUC_GROUP_NEXT_ELEMENT (tem));
          tem = REDUC_GROUP_FIRST_ELEMENT (tem);
        }
      STMT_VINFO_DEF_TYPE (vect_orig_stmt (tem)) = vect_internal_def;
      STMT_VINFO_DEF_TYPE (tem) = vect_internal_def;
    }
  else if (loop_vinfo && LOOP_VINFO_CAN_USE_PARTIAL_VECTORS_P (loop_vinfo))
    {
      vec_loop_masks *masks = &LOOP_VINFO_MASKS (loop_vinfo);

why is this only relevant when we go via vect_transform_reduction?  This looks
like a bit like a misplaced bunch of checks?

Anyway, will test the attached.

Reply via email to