This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Provide macro to override limiting field alignment
On Mon, Dec 10, 2001 at 06:35:26PM -0800, Fred Forsman wrote:
> In my proposed patch the LIMIT_FIELD_ALIGN macro is used to replace
> statements of the form
> x = MIN (x, maximum_field_alignment);
> x = LIMIT_FIELD_ALIGN (x);
Yes. And if you'll examine how maximum_field_alignment is
initialized, it is _only_ set by user code. You should not
be modifying this at all.
> where there is a "usual" maximum_field_alignment of 32 bits which must
> be overridden for vector data.
You are confusing maximum_field_alignment and BIGGEST_FIELD_ALIGNMENT.
The former is part of the implementation of user-specified struct
packing, the later controls the default ABI.
I'd support the creation of a new target hook such as
unsigned int targetm.field_alignment(tree field_decl,
unsigned int current_align);
The default implementation would be
default_field_alignment (decl, current_align)
unsigned int current_align;
return MIN (current_align, (unsigned) BIGGEST_FIELD_ALIGNMENT);