Fix many.c testcase for ppc
authorAnthony Green <green@moxielogic.com>
Fri, 8 Feb 2013 18:56:37 +0000 (13:56 -0500)
committerAnthony Green <green@moxielogic.com>
Fri, 8 Feb 2013 18:56:37 +0000 (13:56 -0500)
ChangeLog
src/powerpc/ffi.c

index 523d049641c9720114aca6c8f0f6bb40d53ef13c..fd6f4774c0f5baa1fa706072c66dcfb7064dcc10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-02  Peter Bergner  <bergner@vnet.ibm.com>
+
+       * src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed
+       on the stack.
+
 2013-02-08  Anthony Green <green@moxielogic.com>
 
        * Makefile.am (EXTRA_DIST): Add missing files.
index 257f02fab3eeec55128864ed2182be3a3c5306cf..add43e01fc80a5924a118c2b721b6f32f445d31a 100644 (file)
@@ -367,6 +367,12 @@ ffi_prep_args_SYSV (extended_cif *ecif, unsigned *const stack)
   /* Check that we didn't overrun the stack...  */
   FFI_ASSERT (copy_space.c >= next_arg.c);
   FFI_ASSERT (gpr_base.u <= stacktop.u - ASM_NEEDS_REGISTERS);
+  /* The assert below is testing that the number of integer arguments agrees
+     with the number found in ffi_prep_cif_machdep().  However, intarg_count
+     is incremeneted whenever we place an FP arg on the stack, so account for
+     that before our assert test.  */
+  if (fparg_count > NUM_FPR_ARG_REGISTERS)
+    intarg_count -= fparg_count - NUM_FPR_ARG_REGISTERS;
 #ifndef __NO_FPRS__
   FFI_ASSERT (fpr_base.u
              <= stacktop.u - ASM_NEEDS_REGISTERS - NUM_GPR_ARG_REGISTERS);