This is the mail archive of the gcc-bugs@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]

[Bug c/11885] [3.3 Regression] Problem with bitfields in packed structs


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11885


janis187 at us dot ibm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com


------- Additional Comments From janis187 at us dot ibm dot com  2003-08-12 16:51 -------
The regression in PR 11885 was introduced or exposed on the 3.3 branch
and mainline by this patch:

--- gcc/gcc/ChangeLog ---

2003-03-31  Jason Merrill  <jason@redhat.com>

        * stor-layout.c (update_alignment_for_field): Respect
        DECL_USER_ALIGN for zero-length bitfields, too.
        * c-decl.c (finish_struct): Don't set DECL_ALIGN for normal
        fields.

--- gcc/gcc/cp/ChangeLog ---

2003-03-31  Jason Merrill  <jason@redhat.com>

        * class.c (check_field_decl): Don't set DECL_ALIGN.

The test case passes for mainline after this large patch:

--- gcc/gcc/ChangeLog ---

2003-04-03  Jason Merrill  <jason@redhat.com>

        * stor-layout.c (do_type_align): New fn, split out from...
        (layout_decl): ...here.  Do all alignment calculations for
        FIELD_DECLs here.
        (update_alignment_for_field): Not here.
        (start_record_layout, debug_rli): Remove unpadded_align.
        * tree.h (struct record_layout_info_s): Remove unpadded_align.
        * c-decl.c (finish_enum): Don't set DECL_SIZE, DECL_ALIGN
        or DECL_MODE on the CONST_DECLs.
        (finish_struct): Don't mess with DECL_ALIGN.

--- gcc/gcc/cp/ChangeLog ---

2003-04-03  Jason Merrill  <jason@redhat.com>

        * class.c (build_vtable): Set DECL_ALIGN here.
        (get_vtable_decl): Not here.
        (layout_vtable_decl): Or here.
        (create_vtable_ptr): Or here.
        (layout_class_type): Or here.
        (check_bitfield_decl): Don't mess with field alignment.

The hunts took place on i686-pc-linux-gnu using the submitter's test case.


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