diff mbox series

Fix type of bitstart in vectorizable_live_operation

Message ID 87a81wnstb.fsf@linaro.org
State New
Headers show
Series Fix type of bitstart in vectorizable_live_operation | expand

Commit Message

Richard Sandiford Sept. 15, 2017, 10:45 a.m. UTC
This patch changes the type of the multiplier applied by
vectorizable_live_operation from unsigned_type_node to bitsizetype,
which matches the type of TYPE_SIZE and is the type expected of a
BIT_FIELD_REF bit position.  This is shown by existing tests when
SVE is added.

Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu.
OK to install?

Richard


2017-09-15  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* tree-vect-loop.c (vectorizable_live_operation): Fix type of
	bitstart.

Comments

Jeff Law Sept. 15, 2017, 3:39 p.m. UTC | #1
On 09/15/2017 04:45 AM, Richard Sandiford wrote:
> This patch changes the type of the multiplier applied by

> vectorizable_live_operation from unsigned_type_node to bitsizetype,

> which matches the type of TYPE_SIZE and is the type expected of a

> BIT_FIELD_REF bit position.  This is shown by existing tests when

> SVE is added.

> 

> Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu.

> OK to install?

> 

> Richard

> 

> 

> 2017-09-15  Richard Sandiford  <richard.sandiford@linaro.org>

> 	    Alan Hayward  <alan.hayward@arm.com>

> 	    David Sherwood  <david.sherwood@arm.com>

> 

> gcc/

> 	* tree-vect-loop.c (vectorizable_live_operation): Fix type of

> 	bitstart.

OK.
jeff
diff mbox series

Patch

Index: gcc/tree-vect-loop.c
===================================================================
--- gcc/tree-vect-loop.c	2017-09-15 11:37:45.639244036 +0100
+++ gcc/tree-vect-loop.c	2017-09-15 11:38:33.276424843 +0100
@@ -7090,7 +7090,7 @@  vectorizable_live_operation (gimple *stm
       vec_lhs = gimple_get_lhs (SLP_TREE_VEC_STMTS (slp_node)[vec_entry]);
 
       /* Get entry to use.  */
-      bitstart = build_int_cst (unsigned_type_node, vec_index);
+      bitstart = bitsize_int (vec_index);
       bitstart = int_const_binop (MULT_EXPR, bitsize, bitstart);
     }
   else