This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libffi: fix powerpc support for functions with many arguments


On 11/27/2009 02:23 PM, Andreas Schwab wrote:
This fixes a bug in the handling of functions with many arguments when
the register space overflows.


Thanks Andreas - please check this into the GCC repository.

AG


Andreas.

2009-11-27 Andreas Schwab<schwab@linux-m68k.org>

	* src/powerpc/ffi.c (ffi_prep_args_SYSV): Advance intarg_count
	when a float argument is passed in memory.
	(ffi_closure_helper_SYSV): Mark general registers as used up when
	a 64bit or soft-float long double argument is passed in memory.

Index: libffi/src/powerpc/ffi.c
===================================================================
--- libffi/src/powerpc/ffi.c	(revision 154702)
+++ libffi/src/powerpc/ffi.c	(working copy)
@@ -185,6 +185,7 @@ ffi_prep_args_SYSV (extended_cif *ecif,
  	    {
  	      *next_arg.f = (float) double_tmp;
  	      next_arg.u += 1;
+	      intarg_count++;
  	    }
  	  else
  	    *fpr_base.d++ = double_tmp;
@@ -1149,6 +1150,7 @@ ffi_closure_helper_SYSV (ffi_closure *cl
  		pst++;
  	      avalue[i] = pst;
  	      pst += 2;
+	      ng = 8;
  	    }
  	  break;

@@ -1222,6 +1224,7 @@ ffi_closure_helper_SYSV (ffi_closure *cl
  		{
  		  avalue[i] = pst;
  		  pst += 4;
+		  ng = 8;
  		}
  	      break;
  	    }



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]