+2019-11-08 Richard Sandiford <richard.sandiford@arm.com>
+
+ * tree-sra.c (create_access): Delay disqualifying the base
+ for poly_int values until we know we have a base.
+
2019-11-08 Andre Vieira <andre.simoesdiasvieira@arm.com>
* tree-vect-loop.c (vect_analyze_loop): Disable epilogue vectorization
--- /dev/null
+/* { dg-options "-O2" } */
+
+typedef struct s { double d[4]; } TYPE;
+
+static inline void
+copy (TYPE *dst, TYPE *src)
+{
+ __SVFloat64_t tmp = *(__SVFloat64_t *) src;
+ *dst = *(TYPE *) &tmp;
+}
+
+void
+foo (TYPE *a)
+{
+ copy (a, a + 1);
+}
{
struct access *access;
poly_int64 poffset, psize, pmax_size;
- HOST_WIDE_INT offset, size, max_size;
tree base = expr;
bool reverse, unscalarizable_region = false;
base = get_ref_base_and_extent (expr, &poffset, &psize, &pmax_size,
&reverse);
- if (!poffset.is_constant (&offset)
- || !psize.is_constant (&size)
- || !pmax_size.is_constant (&max_size))
- {
- disqualify_candidate (base, "Encountered a polynomial-sized access.");
- return NULL;
- }
/* For constant-pool entries, check we can substitute the constant value. */
if (constant_decl_p (base))
if (!DECL_P (base) || !bitmap_bit_p (candidate_bitmap, DECL_UID (base)))
return NULL;
+ HOST_WIDE_INT offset, size, max_size;
+ if (!poffset.is_constant (&offset)
+ || !psize.is_constant (&size)
+ || !pmax_size.is_constant (&max_size))
+ {
+ disqualify_candidate (base, "Encountered a polynomial-sized access.");
+ return NULL;
+ }
+
if (size != max_size)
{
size = max_size;