OSDN Git Service

gcc/
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Jul 2008 15:42:59 +0000 (15:42 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Jul 2008 15:42:59 +0000 (15:42 +0000)
2008-07-18  H.J. Lu  <hongjiu.lu@intel.com>

PR middle-end/36858
* function.c (locate_and_pad_parm): Cap boundary earlier.

testsuite/

2008-07-18  H.J. Lu  <hongjiu.lu@intel.com>

PR middle-end/36858
* gcc.target/i386/vararg-1.c: New.

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

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

index 41b5a49..0ff9b00 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR middle-end/36858
+       * function.c (locate_and_pad_parm): Cap boundary earlier.
+
 2008-07-17  Julian Brown  <julian@codesourcery.com>
 
        * config/arm/arm.c (arm_cxx_determine_class_data_visibility): Make
index 69c2f68..ccf37a1 100644 (file)
@@ -3258,13 +3258,13 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
     = type ? size_in_bytes (type) : size_int (GET_MODE_SIZE (passed_mode));
   where_pad = FUNCTION_ARG_PADDING (passed_mode, type);
   boundary = FUNCTION_ARG_BOUNDARY (passed_mode, type);
+  if (boundary > PREFERRED_STACK_BOUNDARY)
+    boundary = PREFERRED_STACK_BOUNDARY;
   locate->where_pad = where_pad;
   locate->boundary = boundary;
 
   /* Remember if the outgoing parameter requires extra alignment on the
      calling function side.  */
-  if (boundary > PREFERRED_STACK_BOUNDARY)
-    boundary = PREFERRED_STACK_BOUNDARY;
   if (crtl->stack_alignment_needed < boundary)
     crtl->stack_alignment_needed = boundary;
 
index 5c48267..7cc31e8 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR middle-end/36858
+       * gcc.target/i386/vararg-1.c: New.
+
 2008-07-18  Tobias Burnus  <burnus@net-b.de>
 
        * gfortran.dg/parameter_array_init_4.f90: Silence pedantic warning.
diff --git a/gcc/testsuite/gcc.target/i386/vararg-1.c b/gcc/testsuite/gcc.target/i386/vararg-1.c
new file mode 100644 (file)
index 0000000..1875e0a
--- /dev/null
@@ -0,0 +1,32 @@
+/* PR middle-end/36858 */
+/* { dg-do run } */
+/* { dg-options "-w" { target { lp64 } } } */
+/* { dg-options "-w -msse2 -mpreferred-stack-boundary=2" { target { ilp32 } } } */
+
+#include "sse2-check.h"
+#include <stdarg.h>
+#include <emmintrin.h>
+
+int
+__attribute__((noinline))
+test (int a, ...)
+{
+  return a;
+}
+
+__m128 n1 = { -283.3, -23.3, 213.4, 1119.03 };
+
+int
+__attribute__((noinline))
+foo (void)
+{
+  return test (1, n1);
+}
+
+static void
+__attribute__((noinline))
+sse2_test (void)
+{
+  if (foo () != 1)
+    abort ();
+}