public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mark at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/22275] [3.4/4.0/4.1/4.2 Regression] bitfield layout change (regression?)
Date: Wed, 18 Jan 2006 23:00:00 -0000	[thread overview]
Message-ID: <20060118230041.29608.qmail@sourceware.org> (raw)
In-Reply-To: <bug-22275-3760@http.gcc.gnu.org/bugzilla/>



------- Comment #29 from mark at codesourcery dot com  2006-01-18 23:00 -------
Subject: Re:  [3.4/4.0/4.1/4.2 Regression] bitfield
 layout change (regression?)

I think that we should do as follows.

Preserve the original value of maximum_field_alignment when doing
#pragma pack.  Then, for zero-width bitfields, we should align to the
minimum of the original maximum_field_alignment and the otherwise
natural alignment.

The difference between this and the last proposed patch is that I don't
think we should entirely ignore maximum_field_alignment for zero-width
bitfields; if "long long" as a field will only have (say) 2-byte
alignment on some embedded target where structure-packing is the
default, then a "long long : 0;" bitfield should only force 4-byte
alignment.

However, that's an abstract argument; I'm not actually sure what
existing practice was with older versions of GCC.

Again, in the abstract, I think the example in Comment #12 ought to have
size 8 on both IA32 and AMD64 architectures.  I can't see any good
justification for size 12, with a PCC_BITFIELD_TYPES_MATTER ABI.  And, I
think that the size of the structure with #pragma pack(1) ought to be
the same as with __attribute__((packed)).

So, my concern with the patch in Comment #12 is that it would ignore the
pre-set maximum_field_alignment on targets with default structure
packing; other than that, I think it looks fine.


-- 


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


  parent reply	other threads:[~2006-01-18 23:00 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-22275-3760@http.gcc.gnu.org/bugzilla/>
2005-10-17 15:09 ` [Bug middle-end/22275] [3.4/4.0/4.1 " steven at gcc dot gnu dot org
2005-10-31  3:57 ` mmitchel at gcc dot gnu dot org
2005-10-31  7:21 ` steven at gcc dot gnu dot org
2005-10-31  7:44 ` mark at codesourcery dot com
2005-10-31 17:31 ` steven at gcc dot gnu dot org
2005-10-31 23:02 ` pinskia at gcc dot gnu dot org
2005-10-31 23:14 ` steven at gcc dot gnu dot org
2005-11-01 16:42 ` janis at gcc dot gnu dot org
2005-11-01 16:44 ` steven at gcc dot gnu dot org
2005-11-01 16:57 ` pinskia at gcc dot gnu dot org
2005-11-05 19:56 ` pinskia at gcc dot gnu dot org
2005-11-07 17:19 ` steven at gcc dot gnu dot org
2005-12-20  2:34 ` [Bug middle-end/22275] [3.4/4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
2006-01-14 13:56 ` steven at gcc dot gnu dot org
2006-01-14 13:57 ` steven at gcc dot gnu dot org
2006-01-14 14:48 ` steven at gcc dot gnu dot org
2006-01-14 15:17 ` steven at gcc dot gnu dot org
2006-01-14 15:35 ` steven at gcc dot gnu dot org
2006-01-14 15:55 ` steven at gcc dot gnu dot org
2006-01-16 10:23 ` rguenth at gcc dot gnu dot org
2006-01-16 15:14 ` matz at suse dot de
2006-01-16 23:31 ` steven at gcc dot gnu dot org
2006-01-16 23:33 ` steven at gcc dot gnu dot org
2006-01-17 21:07 ` hubicka at gcc dot gnu dot org
2006-01-17 22:12 ` matz at suse dot de
2006-01-17 22:31 ` matz at suse dot de
2006-01-18 23:00 ` mark at codesourcery dot com [this message]
2006-01-18 23:08 ` steven at gcc dot gnu dot org
2006-01-18 23:28 ` mark at codesourcery dot com
2006-01-19 14:44 ` matz at suse dot de
2006-01-19 16:59 ` mark at codesourcery dot com
2006-01-19 17:40 ` steven at gcc dot gnu dot org
2006-01-19 19:14 ` mark at codesourcery dot com
2006-01-20 14:01 ` matz at suse dot de
2006-01-20 16:36 ` matz at suse dot de
2006-01-20 18:02 ` mark at codesourcery dot com
2006-01-23 10:32 ` matz at suse dot de
2006-01-23 11:21 ` matz at suse dot de
2006-01-23 11:23 ` matz at suse dot de
2006-01-23 11:28 ` matz at suse dot de
2006-01-27 23:25 ` rguenth at gcc dot gnu dot org
2006-02-09 23:02 ` [Bug middle-end/22275] [3.4/4.0/4.1/4.2 Regression] bitfield layout change steven at gcc dot gnu dot org
2006-02-10 22:34 ` david dot moore at intel dot com
2006-02-11  0:14 ` david dot moore at intel dot com
2006-02-12  3:59 ` matz at suse dot de
2006-02-13 22:42 ` mmitchel at gcc dot gnu dot org
2006-02-13 22:59 ` mmitchel at gcc dot gnu dot org
2006-02-14 16:13 ` matz at gcc dot gnu dot org
2006-02-14 17:39 ` [Bug middle-end/22275] [3.4/4.0/4.2 " jakub at gcc dot gnu dot org
2006-02-15 12:20 ` matz at gcc dot gnu dot org
2006-02-15 12:24 ` matz at suse dot de
2006-02-15 12:25 ` [Bug middle-end/22275] [3.4/4.0 " rguenth at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060118230041.29608.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).