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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
                 CC|                            |joel.hutton at arm dot com
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot 
gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
#5  0x00000000019c9eeb in vectorizable_conversion (vinfo=0x3985f80, 
    stmt_info=0x39c0f70, gsi=0x0, vec_stmt=0x0, slp_node=0x0, 
    cost_vec=0x7fffffffc4f8) at ../../src/trunk/gcc/tree-vect-stmts.c:4686
4686        ncopies = vect_get_num_copies (loop_vinfo, vectype_in);
(gdb) p debug_generic_expr (vectype_in)
vector(8) short int
$1 = void
(gdb) p loop_vinfo->vectorization_factor 
$2 = {<poly_int_pod<2, unsigned long>> = {coeffs = {4, 0}}, <No data fields>}

that can't work.

(gdb) p debug_gimple_stmt (stmt_info->stmt)
patt_10 = (a_15(D)) <<< ??? >>> (-30574);

the TREE_CODE of this is WIDEN_PLUS_EXPR (we seem to miss an entry for
tree_code_name and pretty-printing for this ... so much for using new
tree-codes).

vectorizable_conversion has

  code = gimple_assign_rhs_code (stmt);
  if (!CONVERT_EXPR_CODE_P (code)
      && code != FIX_TRUNC_EXPR
      && code != FLOAT_EXPR
      && code != WIDEN_PLUS_EXPR
      && code != WIDEN_MINUS_EXPR
      && code != WIDEN_MULT_EXPR
      && code != WIDEN_LSHIFT_EXPR)
    return false;

so it's supposed to handle this case.  I think the special-case is that
the whole stmt is invariant and thus not participating in determining
the vectorization factor (all ops are invariant).  So we're running into

  /* If op0 is an external or constant def, infer the vector type
     from the scalar type.  */
  if (!vectype_in)
    vectype_in = get_vectype_for_scalar_type (vinfo, rhs_type, slp_node);

now we should always be able to use vectype_out for determining ncopies,
we just have to correctly interpret it for WIDEN/NARROW or adjust it.

Leaving to arm folks to resolve.

Reply via email to