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: RFA: M32C: Do not enable PCC_BITFIELD_TYPE_MATTERS


On Thu, 5 Feb 2009, Nick Clifton wrote:

>   Here is another small m32c patch for your consideration.
>
>   This time the problem is that several gcc tests are reporting a
>   warning message along the lines of:
>
>     Offset of packed bit-field [...] has changed in GCC 4.4
>
>   This warning is only significant for targets which use PCC style
>   bitfield alignment where the type of the field affects the alignment
>   of the field.

*And* container size!  ...and something else, which we fail
to discriminate...

>  Since the M32C only uses 8-bit alignment for all
>   types, the type of a bitfield is not actually significant and it is

Hm, that's a slightly different thing than
PCC_BITFIELD_TYPE_MATTERS.

>   safe for PCC_BITFIELD_TYPE_MATTERS to be set to 0.  (It is set to 1
>   by default in gcc/config/elfos.h).

You just changed the ABI of your target.  Not sure that it
matters.

>   Note - in theory this warning message is expected in the gcc tests
>   since they check the pcc_bitfield_type_matters proc.  Eg from
>   gcc.dg/bitfld-15.c:
>
>     /* { dg-message "note: Offset of packed bit-field 'b' has changed in GCC 4.4" "" { target pcc_bitfield_type_matters } } */
>
>   In practice however this does not work for the M32C port because the
>   pcc_bitfield_type_matters proc does not detect that the M32C port
>   (currently) has PCC_BITFIELD_TYPE_MATTERS enabled.  This is because
>   the test in the proc:
>
>     struct foo1 { char x; char :0; char y; };
>     struct foo2 { char x; int :0; char y; };
>     int s[sizeof (struct foo1) != sizeof (struct foo2) ? 1 : -1];
>
>   Assumes that the alignment of the "int" type is greater than the
>   alignment of the "char" type.

No, it does not.  The test above might be wrong for your target
for some reason, but your analysis sounds mixed up with that of
default_packed.

To compare, cris-axis-elf is default_packed
non-pcc_bitfield_type_matters but matches the expectations of
the testsuite.

Something is wrong here.  I can't see what, at the moment. It
can affect the warning NEWS item, so I think we should pinpoint
it.

brgds, H-P


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