This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR50731
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Oct 2011 14:09:51 +0200 (CEST)
- Subject: [PATCH] Fix PR50731
We failed to handle the case of a scalar shift operand in do_binop.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2010-10-27 Richard Guenther <rguenther@suse.de>
PR middle-end/50731
* tree-vect-generic.c (do_binop): Handle scalar operands.
Index: gcc/tree-vect-generic.c
===================================================================
*** gcc/tree-vect-generic.c (revision 180561)
--- gcc/tree-vect-generic.c (working copy)
*************** static tree
*** 125,132 ****
do_binop (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree bitpos, tree bitsize, enum tree_code code)
{
! a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
! b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos);
return gimplify_build2 (gsi, code, inner_type, a, b);
}
--- 125,134 ----
do_binop (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree bitpos, tree bitsize, enum tree_code code)
{
! if (TREE_CODE (TREE_TYPE (a)) == VECTOR_TYPE)
! a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
! if (TREE_CODE (TREE_TYPE (b)) == VECTOR_TYPE)
! b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos);
return gimplify_build2 (gsi, code, inner_type, a, b);
}