This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[RFA] libffi x86 32bit PR13221 fix.


Hi all,

the attached patch fixes the mentioned test case (and the ones I submitted earlier today) from PR13221.
Also some other libffi failures.


Native configuration is i686-pc-linux-gnu

=== libffi Summary ===

# of expected passes		182
# of unsupported tests		2


Ok for mainline?


Andreas

2003-11-30 Hosaka Y <hos@tamanegi.org>

	PR other/13221
	* src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV):
	Align arguments to 32 bits.

Index: src/x86/ffi.c
===================================================================
RCS file: /cvs/gcc/gcc/libffi/src/x86/ffi.c,v
retrieving revision 1.10
diff -u -r1.10 ffi.c
--- src/x86/ffi.c       21 Mar 2003 13:43:20 -0000      1.10
+++ src/x86/ffi.c       29 Nov 2003 18:21:41 -0000
@@ -62,8 +62,8 @@
       size_t z;

       /* Align if necessary */
-      if (((*p_arg)->alignment - 1) & (unsigned) argp)
-       argp = (char *) ALIGN(argp, (*p_arg)->alignment);
+      if ((sizeof(int) - 1) & (unsigned) argp)
+       argp = (char *) ALIGN(argp, sizeof(int));

       z = (*p_arg)->size;
       if (z < sizeof(int))
@@ -301,8 +301,8 @@
       size_t z;

       /* Align if necessary */
-      if (((*p_arg)->alignment - 1) & (unsigned) argp) {
-       argp = (char *) ALIGN(argp, (*p_arg)->alignment);
+      if ((sizeof(int) - 1) & (unsigned) argp) {
+       argp = (char *) ALIGN(argp, sizeof(int));
       }

z = (*p_arg)->size;


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