structure size.
* src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct
placement of float result.
* testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct
cast of "resp" for big-endian 64 bit machines.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@71323
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-09-12 Alan Modra <amodra@bigpond.net.au>
+
+ * src/prep_cif.c (initialize_aggregate): Include tail padding in
+ structure size.
+ * src/powerpc/linux64_closure.S (ffi_closure_LINUX64): Correct
+ placement of float result.
+ * testsuite/libffi.special/unwindtest.cc (closure_test_fn1): Correct
+ cast of "resp" for big-endian 64 bit machines.
+
2003-09-11 Alan Modra <amodra@bigpond.net.au>
* src/types.c (double, longdouble): Merge identical SH and ARM
addi %r1, %r1, 224
blr
# case FFI_TYPE_FLOAT
- lfs %f1, 112+4(%r1)
+ lfs %f1, 112+0(%r1)
mtlr %r0
addi %r1, %r1, 224
blr
ptr++;
}
+ /* Structure size includes tail padding. This is important for
+ structures that fit in one register on ABIs like the PowerPC64
+ Linux ABI that right justify small structs in a register.
+ It's also needed for nested structure layout, for example
+ struct A { long a; char b; }; struct B { struct A x; char y; };
+ should find y at an offset of 2*sizeof(long) and result in a
+ total size of 3*sizeof(long). */
+ arg->size = ALIGN (arg->size, arg->alignment);
+
if (arg->size == 0)
return FFI_BAD_TYPEDEF;
else
(int)(*(int *)args[10]), (int)(*(float *)args[11]),
(int)*(int *)args[12], (int)(*(int *)args[13]),
(int)(*(int *)args[14]), *(int *)args[15],
- (int)(long)userdata, *(int*)resp);
+ (int)(long)userdata, (int)*(ffi_arg*)resp);
- throw *(int*)resp;
+ throw (int)*(ffi_arg*)resp;
}
typedef int (*closure_test_type1)(float, float, float, float, signed short,