From 8bd15d139a58a6e46dc90a1cb2d89f59f32f06c7 Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Fri, 8 Feb 2013 13:56:37 -0500 Subject: [PATCH] Fix many.c testcase for ppc --- ChangeLog | 5 +++++ src/powerpc/ffi.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 523d0496..fd6f4774 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-04-02 Peter Bergner + + * src/powerpc/ffi.c (ffi_prep_args_SYSV): Account for FP args pushed + on the stack. + 2013-02-08 Anthony Green * Makefile.am (EXTRA_DIST): Add missing files. diff --git a/src/powerpc/ffi.c b/src/powerpc/ffi.c index 257f02fa..add43e01 100644 --- a/src/powerpc/ffi.c +++ b/src/powerpc/ffi.c @@ -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);