This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Invalid libffi testcase?
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Andreas Tobler <andreast at gcc dot gnu dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 24 Jan 2004 15:39:34 +0100
- Subject: Invalid libffi testcase?
Hello Andreas,
The testcase libffi.call/pyobj-tc.c fails on SPARC64 at runtime because the
program attemps to store a word to a non word-aligned address. More
specifically, it dies when storing the result value of
ffi_call(&cif, FFI_FN(doit), &result, values);
to 'result', which is defined by
int result;
Now the README file contains this paragraph:
RVALUE is a pointer to a chunk of memory that is to hold the
result of the function call. Currently, it must be
at least one word in size (except for the n32 version
under Irix 6.x, which must be a pointer to an 8 byte
aligned value (a long long). It must also be at least
word aligned (depending on the return type, and the
system's alignment requirements). If RTYPE is
&ffi_type_void, this is ignored. If RVALUE is NULL,
the return value is discarded.
Clearly, on LP64 platforms, the testcase doesn't fulfil the requirements
listed in the "manual".
--
Eric Botcazou