* config/i386/cygming.h (STACK_REALIGN_DEFAULT): Define.
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 28 Feb 2016 14:36:41 +0000 (14:36 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 28 Feb 2016 14:36:41 +0000 (14:36 +0000)
From-SVN: r233791

gcc/ChangeLog
gcc/config/i386/cygming.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/stack-realign-win.c [new file with mode: 0644]

index 85c6301bf6d0de8c1c5e3ae90366025c37b41bad..4db03b62e8346b0c49873b3ccb0d91d6b5d677e2 100644 (file)
@@ -1,3 +1,7 @@
+2016-02-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/i386/cygming.h (STACK_REALIGN_DEFAULT): Define.
+
 2016-02-27  Jeff Law  <law@redhat.com>
 
        Revert
index 7cd8ac51d9388e9c26cbf8c5735ee130449220df..9da473359a571a1fb5e0a48a9d0e3d0b856f7c9f 100644 (file)
@@ -39,6 +39,11 @@ along with GCC; see the file COPYING3.  If not see
 #undef MAX_STACK_ALIGNMENT
 #define MAX_STACK_ALIGNMENT  (TARGET_SEH ? 128 : MAX_OFILE_ALIGNMENT)
 
+/* 32-bit Windows aligns the stack on a 4-byte boundary but SSE instructions
+   may require 16-byte alignment.  */
+#undef STACK_REALIGN_DEFAULT
+#define STACK_REALIGN_DEFAULT TARGET_SSE
+
 /* Support hooks for SEH.  */
 #undef  TARGET_ASM_UNWIND_EMIT
 #define TARGET_ASM_UNWIND_EMIT  i386_pe_seh_unwind_emit
index 89531733c8d795d6d96e426db570fd0296839deb..835ee2bf13891bd9343a67ba145513ab5ca878e6 100644 (file)
@@ -1,3 +1,7 @@
+2016-02-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc.target/i386/stack-realign-win.c: New test.
+
 2016-02-28  Harald Anlauf  <anlauf@gmx.de>
 
        PR fortran/60126
diff --git a/gcc/testsuite/gcc.target/i386/stack-realign-win.c b/gcc/testsuite/gcc.target/i386/stack-realign-win.c
new file mode 100644 (file)
index 0000000..e27a565
--- /dev/null
@@ -0,0 +1,35 @@
+/* { dg-do compile { target *-*-mingw* *-*-cygwin* } } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-msse -O" } */
+
+extern void abort (void);
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+static __m128
+load_m128 (float *e)
+{
+  return * (__m128 *) e;
+}
+
+typedef union
+{
+  __m128  x;
+  float a[4];
+} union128;
+
+void test (void)
+{
+  union128 u;
+  float e[4] __attribute__ ((aligned (16)))
+    = {2134.3343, 1234.635654, 1.2234, 876.8976};
+  int i;
+
+  u.x = load_m128 (e);
+
+  for (i = 0; i < 4; i++)
+    if (u.a[i] != e[i])
+      abort ();
+}
+
+/* { dg-final { scan-assembler "andl\\t\\$-16, %esp" } } */