This is the mail archive of the gcc-patches@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]

[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);
  }
  


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