' ' nothing is known
't' the size of value written/read corresponds to the size of
of the pointed-to type of the argument type
- '1'...'9' specifies the size of value written/read is given by the
+ '1'...'9' specifies the size of value written/read is bound by the
specified argument
*/
&& str[idx] != 'x' && str[idx] != 'X';
}
- /* Return true if load of memory pointed to by argument I is specified
+ /* Return true if load of memory pointed to by argument I is bound
by another argument. In this case set ARG. */
bool
arg_max_access_size_given_by_arg_p (unsigned int i, unsigned int *arg)
--- /dev/null
+/* { dg-do run } */
+
+#define N 23
+#define MAX_LEN 13
+char dst[N + 1];
+
+void __attribute__((noipa))
+invert(const char *id)
+{
+ char buf[MAX_LEN];
+ char *ptr = buf + sizeof(buf); // start from the end of buf
+ *(--ptr) = '\0'; // terminate string
+ while (*id && ptr > buf) {
+ *(--ptr) = *(id++); // copy id backwards
+ }
+ __builtin_strncpy(dst, ptr, N); // copy ptr/buf to dst
+}
+
+
+int main()
+{
+ invert("abcde");
+ if (__builtin_strcmp(dst, "edcba"))
+ __builtin_abort();
+ return 0;
+}
t = TREE_CHAIN (t);
size = TYPE_SIZE_UNIT (TREE_TYPE (TREE_VALUE (t)));
}
- ao_ref_init_from_ptr_and_size (&dref,
- gimple_call_arg (call, i),
- size);
+ poly_int64 size_hwi;
+ if (size
+ && poly_int_tree_p (size, &size_hwi)
+ && coeffs_in_range_p (size_hwi, 0,
+ HOST_WIDE_INT_MAX / BITS_PER_UNIT))
+ {
+ size_hwi = size_hwi * BITS_PER_UNIT;
+ ao_ref_init_from_ptr_and_range (&dref,
+ gimple_call_arg (call, i),
+ true, 0, -1, size_hwi);
+ }
+ else
+ ao_ref_init_from_ptr_and_range (&dref,
+ gimple_call_arg (call, i),
+ false, 0, -1, -1);
if (refs_may_alias_p_1 (&dref, ref, false))
return 1;
}