aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-vectorizer.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 823f39d..7195a2a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2018-01-12 Richard Sandiford <richard.sandiford@linaro.org>
+ * tree-vectorizer.c (get_vec_alignment_for_array_type): Handle
+ polynomial type sizes.
+
+2018-01-12 Richard Sandiford <richard.sandiford@linaro.org>
+
* gimplify.c (gimple_add_tmp_var_fn): Allow variables to have a
poly_uint64 size, rather than requiring an unsigned HOST_WIDE_INT size.
(gimple_add_tmp_var): Likewise.
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index b5bdf67..a0cc2d6 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -1015,12 +1015,13 @@ static unsigned
get_vec_alignment_for_array_type (tree type)
{
gcc_assert (TREE_CODE (type) == ARRAY_TYPE);
+ poly_uint64 array_size, vector_size;
tree vectype = get_vectype_for_scalar_type (strip_array_types (type));
if (!vectype
- || !TYPE_SIZE (type)
- || TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST
- || tree_int_cst_lt (TYPE_SIZE (type), TYPE_SIZE (vectype)))
+ || !poly_int_tree_p (TYPE_SIZE (type), &array_size)
+ || !poly_int_tree_p (TYPE_SIZE (vectype), &vector_size)
+ || maybe_lt (array_size, vector_size))
return 0;
return TYPE_ALIGN (vectype);