This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

vector shift regression on sparc


gcc.dg/pr48616.c segfaults on sparc as of a day or two ago

vectorizable_shift() crashes because op1_vectype is NULL and
we hit this code path:

  /* Vector shifted by vector.  */
  if (!scalar_shift_arg)
    {
      optab = optab_for_tree_code (code, vectype, optab_vector);
      if (vect_print_dump_info (REPORT_DETAILS))
	fprintf (vect_dump, "vector/vector shift/rotate found.");
=>    if (TYPE_MODE (op1_vectype) != TYPE_MODE (vectype))

dt[1] is vect_external_def and slp_node is non-NULL.

Indeed, when the 'dt' arg to vect_is_simple_use_1() is
vect_external_def *vectype will be set to NULL.

And scalar_shift_arg gets set to false because of this loop
check:

      if (slp_node)
        {
          VEC (gimple, heap) *stmts = SLP_TREE_SCALAR_STMTS (slp_node);
          gimple slpstmt;

          FOR_EACH_VEC_ELT (gimple, stmts, k, slpstmt)
            if (!operand_equal_p (gimple_assign_rhs2 (slpstmt), op1, 0))
              scalar_shift_arg = false;
        }

Indeed, this crashing test was added by this change:

2011-10-28  Jakub Jelinek  <jakub@redhat.com>

       * tree-vect-stmts.c (vectorizable_shift): Give up if op1 has different
       vector mode from vectype's mode.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]