MEM_ALIGN (stack_parm))))
|| (data->nominal_type
&& TYPE_ALIGN (data->nominal_type) > MEM_ALIGN (stack_parm)
- && (MEM_ALIGN (stack_parm) < PREFERRED_STACK_BOUNDARY
+ && ((MEM_ALIGN (stack_parm)
+ < MIN (BIGGEST_ALIGNMENT, MAX_SUPPORTED_STACK_ALIGNMENT))
/* If its address is taken, make a local copy whose
maximum alignment is MAX_SUPPORTED_STACK_ALIGNMENT.
*/
/* { dg-do compile } */
/* { dg-options "-O2 -mavx2" } */
-/* { dg-final { scan-assembler-not "and\[lq\]?\[\\t \]*\\$-32,\[\\t \]*%\[re\]?sp" { xfail ia32 } } } */
+/* { dg-final { scan-assembler "and\[lq\]?\[\\t \]*\\$-32,\[\\t \]*%\[re\]?sp" } } */
#include "pr120839-1a.c"
--- /dev/null
+/* { dg-do run { target avx2_runtime } } */
+/* { dg-options "-O2 -mavx2" } */
+
+typedef double v4df __attribute__((vector_size(32)));
+typedef double v2df __attribute__((vector_size(16)));
+typedef struct {
+ v2df a[2];
+} c __attribute__((aligned(32)));
+v4df d;
+c v;
+
+__attribute__ ((noipa))
+void
+foo (float a1, float a2, float a3, float a4, float a5, float a6, c f)
+{
+ d = *(v4df *) &f;
+}
+
+__attribute__ ((noipa))
+void
+bar (void)
+{
+ foo (0, 0, 0, 0, 0, 0, v);
+}
+
+int
+main ()
+{
+ bar ();
+ return 0;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-avx512f -mavx2" } */
+/* { dg-final { scan-assembler-times "vmovupd.*, %ymm0" 1 } } */
+/* { dg-final { scan-assembler "and\[lq\]?\[\\t \]*\\$-32,\[\\t \]*%\[re\]?sp" } } */
+/* { dg-final { scan-assembler-not "vmovapd.*, %ymm0" } } */
+
+typedef double v4df __attribute__((vector_size(32)));
+typedef double v2df __attribute__((vector_size(16)));
+typedef struct {
+ v2df a[2];
+} c __attribute__((aligned(32)));
+v4df d;
+c v;
+
+void
+foo (float a1, float a2, float a3, float a4, float a5, float a6, c f)
+{
+ d = *(v4df *) &f;
+}
--- /dev/null
+/* { dg-do run { target avx2_runtime } } */
+/* { dg-options "-O2 -mavx2" } */
+
+typedef double v4df __attribute__((vector_size(32)));
+typedef struct {
+ v4df a[2];
+} c __attribute__((aligned(64)));
+v4df d;
+c v;
+
+__attribute__ ((noipa))
+void
+foo (float a1, float a2, float a3, float a4, float a5, float a6, c f)
+{
+ d = *(v4df *) &f;
+}
+
+__attribute__ ((noipa))
+void
+bar (void)
+{
+ foo (0, 0, 0, 0, 0, 0, v);
+}
+
+int
+main ()
+{
+ bar ();
+ return 0;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-avx512f -mavx2" } */
+/* { dg-final { scan-assembler-times "vmovapd.*, %ymm0" 1 } } */
+/* { dg-final { scan-assembler-not "vmovupd.*, %ymm0" } } */
+/* { dg-final { scan-assembler-not "and\[lq\]?\[\\t \]*\\$-64,\[\\t \]*%\[re\]?sp" } } */
+
+typedef double v4df __attribute__((vector_size(32)));
+typedef struct {
+ v4df a[2];
+} c __attribute__((aligned(64)));
+v4df d;
+c v;
+
+void
+foo (float a1, float a2, float a3, float a4, float a5, float a6, c f)
+{
+ d = *(v4df *) &f;
+}
--- /dev/null
+/* { dg-do run { target avx512f_runtime } } */
+/* { dg-options "-O2 -mavx512f" } */
+
+typedef double v4df __attribute__((vector_size(32)));
+typedef double v8df __attribute__((vector_size(64)));
+typedef struct {
+ v4df a[2];
+} c __attribute__((aligned(64)));
+v8df d;
+c v;
+
+__attribute__ ((noipa))
+void
+foo (float a1, float a2, float a3, float a4, float a5, float a6, c f)
+{
+ d = *(v8df *) &f;
+}
+
+__attribute__ ((noipa))
+void
+bar (void)
+{
+ foo (0, 0, 0, 0, 0, 0, v);
+}
+
+int
+main ()
+{
+ bar ();
+ return 0;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx512f" } */
+/* { dg-final { scan-assembler-times "vmovupd.*, %zmm0" 1 } } */
+/* { dg-final { scan-assembler "and\[lq\]?\[\\t \]*\\$-64,\[\\t \]*%\[re\]?sp" } } */
+/* { dg-final { scan-assembler-not "vmovapd.*, %zmm0" } } */
+
+typedef double v4df __attribute__((vector_size(32)));
+typedef double v8df __attribute__((vector_size(64)));
+typedef struct {
+ v4df a[2];
+} c __attribute__((aligned(64)));
+v8df d;
+c v;
+
+void
+foo (float a1, float a2, float a3, float a4, float a5, float a6, c f)
+{
+ d = *(v8df *) &f;
+}