Fix type of bitstart in vectorizable_live_operation
authorRichard Sandiford <richard.sandiford@linaro.org>
Mon, 18 Sep 2017 15:28:55 +0000 (15:28 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 18 Sep 2017 15:28:55 +0000 (15:28 +0000)
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.

2017-09-18  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.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r252931

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

index 4c052cc55bc0b4d594c55f9d4fb2664ceb0f60c3..9142af1bb061b10d4841c51da283f345e4333890 100644 (file)
@@ -1,3 +1,10 @@
+2017-09-18  Richard Sandiford  <richard.sandiford@linaro.org>
+           Alan Hayward  <alan.hayward@arm.com>
+           David Sherwood  <david.sherwood@arm.com>
+
+       * tree-vect-loop.c (vectorizable_live_operation): Fix type of
+       bitstart.
+
 2017-09-18  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
            David Sherwood  <david.sherwood@arm.com>
index 5d29ef5275cdde4adb6f6d10bfe427daaba0f04a..3140bbbbfff9b7443881caaae97ec26b74838a98 100644 (file)
@@ -7091,7 +7091,7 @@ vectorizable_live_operation (gimple *stmt,
       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