OSDN Git Service

gcc/
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Feb 2009 20:37:49 +0000 (20:37 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Feb 2009 20:37:49 +0000 (20:37 +0000)
2009-02-16  H.J. Lu  <hongjiu.lu@intel.com>

PR target/37049
* config/i386/i386.c (ix86_expand_push): Set memory alignment
to function argument boundary.

gcc/testsuite/

2009-02-16  H.J. Lu  <hongjiu.lu@intel.com>

PR target/37049
* gcc.target/i386/push-1.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144209 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/push-1.c [new file with mode: 0644]

index a881d27..981f150 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/37049
+       * config/i386/i386.c (ix86_expand_push): Set memory alignment
+       to function argument boundary.
+
 2009-02-16  Hariharan Sandanagobalane  <hariharan@picochip.com>
 
        * config/picochip/picochip.md (lea_add): Allow any nonimmediate
index 9c758a2..582a9dc 100644 (file)
@@ -12594,6 +12594,12 @@ ix86_expand_push (enum machine_mode mode, rtx x)
     emit_move_insn (stack_pointer_rtx, tmp);
 
   tmp = gen_rtx_MEM (mode, stack_pointer_rtx);
+
+  /* When we push an operand onto stack, it has to be aligned at least
+     at the function argument boundary.  */
+  set_mem_align (tmp,
+                ix86_function_arg_boundary (mode, NULL_TREE));
+
   emit_move_insn (tmp, x);
 }
 
index f7d499c..73f0bc5 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/37049
+       * gcc.target/i386/push-1.c: New.
+
 2009-02-15  Uros Bizjak  <ubizjak@gmail.com>
 
        * gcc.dg/struct/w_prof_single_str_global.c: Mask return value.
diff --git a/gcc/testsuite/gcc.target/i386/push-1.c b/gcc/testsuite/gcc.target/i386/push-1.c
new file mode 100644 (file)
index 0000000..cf5a104
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-w -msse2 -Os" } */
+
+typedef float __m128 __attribute__ ((__vector_size__ (16), __may_alias__));
+
+extern void foo (__m128 x, __m128 y ,__m128 z ,__m128 a, int size);
+
+void
+bar (void)
+{
+  __m128 x = { 1.0 };
+  foo (x, x, x, x, 5);
+}
+
+/* { dg-final { scan-assembler-not "movups" } } */