}
tree len = gimple_call_arg (g, 2);
- gcc_assert (tree_fits_shwi_p (len));
- unsigned HOST_WIDE_INT size_in_bytes = tree_to_shwi (len);
- gcc_assert (size_in_bytes);
+ gcc_assert (poly_int_tree_p (len));
g = gimple_build_assign (make_ssa_name (pointer_sized_int_node),
NOP_EXPR, base);
tree base_addr = gimple_assign_lhs (g);
/* Generate direct emission if size_in_bytes is small. */
- if (size_in_bytes
- <= (unsigned)param_use_after_scope_direct_emission_threshold)
+ unsigned threshold = param_use_after_scope_direct_emission_threshold;
+ if (tree_fits_uhwi_p (len) && tree_to_uhwi (len) <= threshold)
{
+ unsigned HOST_WIDE_INT size_in_bytes = tree_to_uhwi (len);
const unsigned HOST_WIDE_INT shadow_size
= shadow_mem_size (size_in_bytes);
const unsigned int shadow_align
--- /dev/null
+/* { dg-skip-if "" { no_fsanitize_address } } */
+/* { dg-options "-fsanitize=address -fsanitize-address-use-after-scope" } */
+
+#include <arm_sve.h>
+
+__attribute__((noinline, noclone)) int
+foo (char *a)
+{
+ int i, j = 0;
+ asm volatile ("" : "+r" (a) : : "memory");
+ for (i = 0; i < 12; i++)
+ j += a[i];
+ return j;
+}
+
+int
+main ()
+{
+ int i, j = 0;
+ for (i = 0; i < 4; i++)
+ {
+ char a[12];
+ __SVInt8_t freq;
+ __builtin_bcmp (&freq, a, 10);
+ __builtin_memset (a, 0, sizeof (a));
+ j += foo (a);
+ }
+ return j;
+}