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]

Re: [patch] libffi darwin structure implementation (PPC)


David Edelsohn wrote:

	This patch probably is algorithmically correct for long double,
but not for structures in general.  Long doubles are word aligned, so
there is no strangeness about padding.

	Currently GCC structure passing on Darwin does not conform to the
AIX/Darwin ABI.  The recent patch to the AIX port makes it conform and a
patch to the PPC64 Linux port makes it conform to its revised ABI (padded
on the opposite end from AIX).  Darwin continues the backward-compatible
alignment that depends on whether the object size is a power of 2.


You say that the things written in the OS-X runtime convention do not match the reality? Would not astonish me.
Ok, which patch? I don't see any recent patch for AIX. With the new testsuite I continously check if my tests pass or not.
The last build was from 'gcc version 3.4 20030828 (experimental)'


I'll happily rework my patch when I know on what to rely on.
Well, not so happy since I spent a lot of work into this and now you make me think it's somehow wasted. (only time aspect, not personal)



Some technical comments about the patch:

+ /* Don't align arguments for darwin since the first element in a + * struct is responsible for alignment. We take care about this in + * prep_cif_machdep.
+ */
+
+#ifndef POWERPC_DARWIN
arg->size = ALIGN(arg->size, (*ptr)->alignment);
+#endif
arg->size += (*ptr)->size;
arg->alignment = (arg->alignment > (*ptr)->alignment) ?


This comment does not make sense and does not match the code. The code is
calculating the size, not the alignment. The question is whether arg->size is the raw value or the value rounded up to the alignment.

You're right. Sorry. Hopefully fixed.


+ if (ng < 8 ) { ^--- minor formatting mistake.

Fixed, plus two more instances.


Thank you for the review time!

Regards,

Andreas


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