[PATCH] Provide macro to override limiting field alignment

Richard Henderson rth@redhat.com
Mon Dec 10 20:28:00 GMT 2001


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);
> 
> with
> 
>    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

  unsigned int
  default_field_alignment (decl, current_align)
	tree decl;
	unsigned int current_align;
  {
    return MIN (current_align, (unsigned) BIGGEST_FIELD_ALIGNMENT);
  }



r~



More information about the Gcc-patches mailing list