Use SCALAR_TYPE_MODE in vect_create_epilog_for_reduction
authorRichard Sandiford <richard.sandiford@linaro.org>
Mon, 23 Oct 2017 09:40:51 +0000 (09:40 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 23 Oct 2017 09:40:51 +0000 (09:40 +0000)
This follows on from similar changes a couple of months ago and
is needed when general modes have variable size.

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.

From-SVN: r254002

gcc/ChangeLog
gcc/tree-vect-loop.c

index d53514ddcca6af32f9a4654d15c7b01540d872e9..3fc03ad08cd3a86281fe12d2bf8a89d1d154537c 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-23  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       * tree-vect-loop.c (vect_create_epilog_for_reduction): Use
+       SCALAR_TYPE_MODE instead of TYPE_MODE.
+
 2017-10-23  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
            David Sherwood  <david.sherwood@arm.com>
index 7fb09c466285328407e4ce53b9425db52980022f..3b1f95fca8bcd0749f952962ea7a01d4ea3f6006 100644 (file)
@@ -4487,7 +4487,7 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple *stmt,
       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));