static tree
native_interpret_vector (tree type, const unsigned char *ptr, unsigned int len)
{
- tree etype;
- unsigned int size;
- unsigned HOST_WIDE_INT count;
+ unsigned HOST_WIDE_INT size;
- etype = TREE_TYPE (type);
- size = GET_MODE_SIZE (SCALAR_TYPE_MODE (etype));
- if (!TYPE_VECTOR_SUBPARTS (type).is_constant (&count)
- || size * count > len)
+ if (!tree_to_poly_uint64 (TYPE_SIZE_UNIT (type)).is_constant (&size)
+ || size > len)
return NULL_TREE;
+ unsigned HOST_WIDE_INT count = TYPE_VECTOR_SUBPARTS (type).to_constant ();
return native_interpret_vector_part (type, ptr, len, count, 1);
}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=znver4 --param vect-partial-vector-usage=2 -fno-vect-cost-model -fdump-tree-vect" } */
+
+int a[4096];
+
+void foo ()
+{
+ for (int i = 1; i < 4095; ++i)
+ a[i] = 42;
+}
+
+/* { dg-final { scan-tree-dump-not "VIEW_CONVERT_EXPR" "vect" } } */