re PR target/52991 (attribute packed broken on mingw32?)
authorJakub Jelinek <jakub@redhat.com>
Wed, 28 Feb 2018 17:17:29 +0000 (18:17 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 28 Feb 2018 17:17:29 +0000 (18:17 +0100)
commitba64c7b8934fbd59a1d5bd370a4aaab4bf2d0ed2
tree592065ce2afe3ed0b78c452328c6359b99bee5f7
parent8dd64cdfa78a0f48c89966a5e59dad46c4bdf21f
re PR target/52991 (attribute packed broken on mingw32?)

PR target/52991
* stor-layout.c (update_alignment_for_field): For
targetm.ms_bitfield_layout_p (rli->t), if !is_bitfield
&& !DECL_PACKED (field), do the alignment update, just use
only desired_align instead of MAX (type_align, desired_align)
as the alignment.
(place_field): Don't do known_align < desired_align handling
early if targetm.ms_bitfield_layout_p (rli->t) and rli->prev_field
is non-NULL, instead do it after rli->prev_field handling and
only if not within a bitfield word.  For DECL_PACKED (field)
use type_align of BITS_PER_UNIT.

* gcc.dg/bf-ms-layout.c: Revert 2012-04-26 changes.
* gcc.dg/bf-ms-layout-2.c: Revert 2012-02-23 changes.
* gcc.dg/bf-ms-layout-4.c: New test.
* gcc.dg/bf-ms-layout-5.c: New test.

From-SVN: r258075
gcc/ChangeLog
gcc/stor-layout.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/bf-ms-layout-2.c
gcc/testsuite/gcc.dg/bf-ms-layout-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/bf-ms-layout-5.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/bf-ms-layout.c