This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: vector shift regression on sparc
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: gcc at gcc dot gnu dot org, jakub at redhat dot com, rth at redhat dot com
- Date: Sun, 30 Oct 2011 10:50:15 +0100
- Subject: Re: vector shift regression on sparc
- References: <20111030.003832.1258043789012300394.davem@davemloft.net>
On Sun, Oct 30, 2011 at 5:38 AM, David Miller <davem@davemloft.net> wrote:
>
> 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:
Yeah, I thought testing the scalar modes would have been more natural.
> 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.
>