[PATCH] IA-32 bitfields (was Re: libgcc_s, Linux, and PT_GNU_EH_FRAME, and binutils)

Richard Henderson rth@redhat.com
Tue Aug 6 17:26:00 GMT 2002


On Tue, Aug 06, 2002 at 06:40:12PM -0400, Jakub Jelinek wrote:
> As I misused ADJUST_FIELD_ALIGN instead of
> creating new ADJUST_FIELD_TYPE_ALIGN or something, ADJUST_FIELD_ALIGN
> will see in this case that DECL_USER_ALIGN is set on the field and bail out,

Perhaps this is fixable by giving ADJUST_FIELD_ALIGN
the type itself?  I.e. where you have

+         if (! TYPE_USER_ALIGN (type))
+           type_align = ADJUST_FIELD_ALIGN (field, type_align);

instead have

	type_align = ADJUST_FIELD_ALIGN (type, type_align)

and then have x86_field_alignment do 

  tree type;

  if (TARGET_64BIT || TARGET_ALIGN_DOUBLE)
    return computed;
  if (TYPE_P (field))
    {
      type = field;
      if (TYPE_USER_ALIGN (type))
	return computed;
    }
  else
    {
      if (DECL_USER_ALIGN (field))
	return computed;
      type = TREE_TYPE (field);
    }

  // etc

An extremely minor update to the ppc port will be required
here as well.

Also, it would appear that some of your changes are buggy:

+      if (! TYPE_USER_ALIGN (field))
+       type_align = ADJUST_FIELD_ALIGN (field, type_align);

Should be testing TYPE_USER_ALIGN of the type, not the field.

> Now, the question is, should all this PCC_BITFIELD_TYPE_MATTERS and
> BITFIELD_NBYTES_LIMITED handling be skipped if DECL_USER_ALIGN is set?

I'm gonna say no, just because no one's ever considered that
before.  Changing that does not fix compatibility with 2.95.


r~



More information about the Gcc-patches mailing list