@@ -8327,6 +8327,7 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT);
dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
if (dest_align < (int) TYPE_ALIGN (desttype)
+ || src_align < (int) TYPE_ALIGN (desttype)
|| src_align < (int) TYPE_ALIGN (srctype))
return NULL_TREE;
@@ -705,7 +705,7 @@ static void
expand_one_stack_var_at (tree decl, HOST_WIDE_INT offset)
{
/* Alignment is unsigned. */
- unsigned HOST_WIDE_INT align;
+ unsigned HOST_WIDE_INT align, max_align;
rtx x;
/* If this fails, we've overflowed the stack frame. Error nicely? */
@@ -722,10 +722,9 @@ expand_one_stack_var_at (tree decl, HOST_WIDE_INT offset)
offset -= frame_phase;
align = offset & -offset;
align *= BITS_PER_UNIT;
- if (align == 0)
- align = STACK_BOUNDARY;
- else if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
- align = MAX_SUPPORTED_STACK_ALIGNMENT;
+ max_align = crtl->max_used_stack_slot_alignment;
+ if (align == 0 || align > max_align)
+ align = max_align;
DECL_ALIGN (decl) = align;
DECL_USER_ALIGN (decl) = 0;
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+
+typedef float V __attribute__ ((vector_size (16)));
+V g;
+float d[4] = { 4, 3, 2, 1 };
+
+int
+main ()
+{
+ V e;
+ __builtin_memcpy (&e, &d, sizeof (d));
+ V f = { 5, 15, 25, 35 };
+ e = e * f;
+ g = e;
+ return 0;
+}
@@ -0,0 +1,16 @@
+/* { dg-do run } */
+
+typedef float V __attribute__ ((vector_size (16)));
+V g;
+
+int
+main ()
+{
+ float d[4] = { 4, 3, 2, 1 };
+ V e;
+ __builtin_memcpy (&e, &d, sizeof (d));
+ V f = { 5, 15, 25, 35 };
+ e = e * f;
+ g = e;
+ return 0;
+}