OSDN Git Service

* src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Dec 2009 10:06:18 +0000 (10:06 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Dec 2009 10:06:18 +0000 (10:06 +0000)
double' arguments.

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

libffi/ChangeLog
libffi/src/sparc/ffi.c

index 8f28614..517ac4e 100644 (file)
@@ -1,5 +1,10 @@
 2009-12-11  Eric Botcazou  <ebotcazou@adacore.com>
 
+       * src/sparc/ffi.c (ffi_closure_sparc_inner_v9): Properly align 'long
+       double' arguments.
+
+2009-12-11  Eric Botcazou  <ebotcazou@adacore.com>
+
        * testsuite/libffi.call/ffitest.h: Define PRIuPTR on Solaris < 10.
 
 2009-12-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
index 3b73f0c..1d01f59 100644 (file)
@@ -599,6 +599,11 @@ ffi_closure_sparc_inner_v9(ffi_closure *closure,
          /* Right-justify.  */
          argn += ALIGN(arg_types[i]->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
 
+         /* Align on a 16-byte boundary.  */
+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
+         if (arg_types[i]->type == FFI_TYPE_LONGDOUBLE && (argn % 2) != 0)
+           argn++;
+#endif
          if (i < fp_slot_max
              && (arg_types[i]->type == FFI_TYPE_FLOAT
                  || arg_types[i]->type == FFI_TYPE_DOUBLE