public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/28161]  New: Wrong bit field layout with -mms-bitfields
@ 2006-06-25  8:47 kkojima at gcc dot gnu dot org
  2006-06-26 20:57 ` [Bug middle-end/28161] " seongbae dot park at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2006-06-25  8:47 UTC (permalink / raw)
  To: gcc-bugs

Several g++ tests in tmpdir-g++.dg-struct-layout-1 fail with
the execution error.  A reduced testcase is

extern "C" void abort (void);

struct S
{
  long long d:23;
  int e:32;
  int f:32;
} a;

int main (void)
{
  a.e = -3;
  a.f = 1;
  if (a.e != -3)
    abort ();
  return 0;
}

which shows that the current compiler allocates a.e and a.f in
an overlapped manner with -mms-bitfields.  With that option,
the 4.1 compiler allocates a field in the first 8-byte for a.d,
the next 4-byte for a.e and the another 4-byte for a.f, but 4.2
allocates 23-bit for a.d, the next 32-bit for a.e and the last
32-bit for a.f in the same 8-byte.


-- 
           Summary: Wrong bit field layout with -mms-bitfields
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kkojima at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-07-15 23:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-25  8:47 [Bug middle-end/28161] New: Wrong bit field layout with -mms-bitfields kkojima at gcc dot gnu dot org
2006-06-26 20:57 ` [Bug middle-end/28161] " seongbae dot park at gmail dot com
2006-06-26 21:21 ` seongbae dot park at gmail dot com
2006-06-26 23:28 ` kkojima at gcc dot gnu dot org
2006-06-26 23:45 ` seongbae dot park at gmail dot com
2006-06-27  1:34 ` kkojima at gcc dot gnu dot org
2006-06-29 21:58 ` patchapp at dberlin dot org
2006-07-15  6:59 ` kkojima at gcc dot gnu dot org
2006-07-15 23:13 ` kkojima at gcc dot gnu dot org

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).