+ /* Handle compatibility with PCC. Note that if the record has any
+ variable-sized fields, we need not worry about compatibility. */
+#ifdef PCC_BITFIELD_TYPE_MATTERS
+ if (PCC_BITFIELD_TYPE_MATTERS
+ && TREE_CODE (field) == FIELD_DECL
+ && type != error_mark_node
+ && DECL_BIT_FIELD (field)
+ && ! DECL_PACKED (field)
+ && maximum_field_alignment == 0
+ && ! integer_zerop (DECL_SIZE (field))
+ && host_integerp (DECL_SIZE (field), 1)
+ && host_integerp (rli->offset, 1)
+ && host_integerp (TYPE_SIZE (type), 1))
+ {
+ unsigned int type_align = TYPE_ALIGN (type);
+ tree dsize = DECL_SIZE (field);
+ HOST_WIDE_INT field_size = tree_low_cst (dsize, 1);
+ HOST_WIDE_INT offset = tree_low_cst (rli->offset, 0);
+ HOST_WIDE_INT bit_offset = tree_low_cst (rli->bitpos, 0);
+
+ /* A bit field may not span more units of alignment of its type
+ than its type itself. Advance to next boundary if necessary. */
+ if ((((offset * BITS_PER_UNIT + bit_offset + field_size +
+ type_align - 1)
+ / type_align)
+ - (offset * BITS_PER_UNIT + bit_offset) / type_align)
+ > tree_low_cst (TYPE_SIZE (type), 1) / type_align)
+ rli->bitpos = round_up (rli->bitpos, type_align);
+ }
+#endif
+
+#ifdef BITFIELD_NBYTES_LIMITED
+ if (BITFIELD_NBYTES_LIMITED
+ && TREE_CODE (field) == FIELD_DECL
+ && type != error_mark_node
+ && DECL_BIT_FIELD_TYPE (field)
+ && ! DECL_PACKED (field)
+ && ! integer_zerop (DECL_SIZE (field))
+ && host_integerp (DECL_SIZE (field), 1)
+ && host_integerp (rli->offset, 1)
+ && host_integerp (TYPE_SIZE (type), 1))
+ {
+ unsigned int type_align = TYPE_ALIGN (type);
+ tree dsize = DECL_SIZE (field);
+ HOST_WIDE_INT field_size = tree_low_cst (dsize, 1);
+ HOST_WIDE_INT offset = tree_low_cst (rli->offset, 0);
+ HOST_WIDE_INT bit_offset = tree_low_cst (rli->bitpos, 0);
+
+ if (maximum_field_alignment != 0)
+ type_align = MIN (type_align, maximum_field_alignment);
+ /* ??? This test is opposite the test in the containing if
+ statement, so this code is unreachable currently. */
+ else if (DECL_PACKED (field))
+ type_align = MIN (type_align, BITS_PER_UNIT);
+
+ /* A bit field may not span the unit of alignment of its type.
+ Advance to next boundary if necessary. */
+ /* ??? This code should match the code above for the
+ PCC_BITFIELD_TYPE_MATTERS case. */
+ if ((offset * BITS_PER_UNIT + bit_offset) / type_align
+ != ((offset * BITS_PER_UNIT + bit_offset + field_size - 1)
+ / type_align))
+ rli->bitpos = round_up (rli->bitpos, type_align);
+ }
+#endif