diff mbox series

Use SCALAR_TYPE_MODE in vect_create_epilog_for_reduction

Message ID 87bmkyyzfb.fsf@linaro.org
State New
Headers show
Series Use SCALAR_TYPE_MODE in vect_create_epilog_for_reduction | expand

Commit Message

Richard Sandiford Oct. 23, 2017, 9:40 a.m. UTC
This follows on from similar changes a couple of months ago and
is needed when general modes have variable size.

Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu.
Applied as obvious.

Richard


2017-10-23  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Use
	SCALAR_TYPE_MODE instead of TYPE_MODE.
diff mbox series

Patch

Index: gcc/tree-vect-loop.c
===================================================================
--- gcc/tree-vect-loop.c	2017-10-22 21:04:50.136830154 +0100
+++ gcc/tree-vect-loop.c	2017-10-23 10:39:37.711243373 +0100
@@ -4487,7 +4487,7 @@  vect_create_epilog_for_reduction (vec<tr
       gcc_assert (gimple_assign_rhs_code (vec_stmt) == VEC_COND_EXPR);
 
       int scalar_precision
-	= GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (vectype)));
+	= GET_MODE_PRECISION (SCALAR_TYPE_MODE (TREE_TYPE (vectype)));
       tree cr_index_scalar_type = make_unsigned_type (scalar_precision);
       tree cr_index_vector_type = build_vector_type
 	(cr_index_scalar_type, TYPE_VECTOR_SUBPARTS (vectype));