--- /dev/null
+/* { dg-additional-options "-O1" } */
+/* { dg-additional-options "-mcpu=neoverse-n2" { target aarch64*-*-* } } */
+
+#include "tree-vect.h"
+
+typedef struct {
+ int _M_current;
+} __normal_iterator;
+
+typedef struct {
+ char _M_elems[5];
+} array_5;
+
+__normal_iterator __trans_tmp_1 = {-5};
+
+__attribute__((noipa))
+array_5 copySourceIntoTarget() {
+ array_5 target;
+ char* target_it = target._M_elems;
+
+ while (__trans_tmp_1._M_current != 0) {
+ *target_it = 1;
+ __trans_tmp_1._M_current++;
+ target_it++;
+ }
+
+ return target;
+}
+
+int main ()
+{
+ check_vect ();
+
+ array_5 res = copySourceIntoTarget();
+
+#pragma GCC novector
+ for (int i = 0; i < 5; i++)
+ if (res._M_elems[i] != 1)
+ __builtin_abort ();
+}
can provide a may-def variant. */
if (may_def_ok)
{
- ao_ref_init_from_ptr_and_size (
- write, gimple_call_arg (stmt, 0),
- TYPE_SIZE_UNIT (
- TREE_TYPE (gimple_call_arg (stmt, stored_value_index))));
+ ao_ref_init_from_ptr_and_range (
+ write, gimple_call_arg (stmt, 0), true, 0, -1,
+ tree_to_poly_int64 (TYPE_SIZE (
+ TREE_TYPE (gimple_call_arg (stmt, stored_value_index)))));
return true;
}
break;