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] |
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.
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.
+ if (ng < 8 ) { ^--- minor formatting mistake.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |