public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/25246]  New: [gomp] #pragma pack() inside of structure
@ 2005-12-03 19:37 jakub at gcc dot gnu dot org
  2005-12-08  8:55 ` [Bug c/25246] " jakub at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-12-03 19:37 UTC (permalink / raw)
  To: gcc-bugs

#pragma pack(1)
struct S
{
  char h;
  int i;
#pragma pack()
  int j;
};
struct S s;
void *i = &s.i, *j = &s.j;

(distilled from Linux kernel) used to compile in 4.0.x, though the whole struct
wasn't really packed at all (i at offset 4, j at offset 8).
gomp #pragma handling rejects this.

Another testcase is:
#pragma pack(1)
struct S
{
  char h;
  struct T { int h1; char h2[3]; } t;
  int i;
#pragma pack()
  int j;
};
struct S s;
void *i = &s.i, *j = &s.j;
void *h1 = &s.t.h1, *h2 = &s.t.h2[0];

Here, h1 was s+1, h2 s+5, i s+8 and j s+12, i.e. struct T used to be packed
and struct S wasn't packed.


-- 
           Summary: [gomp] #pragma pack() inside of structure
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: openmp
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-12-08  8:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-03 19:37 [Bug c/25246] New: [gomp] #pragma pack() inside of structure jakub at gcc dot gnu dot org
2005-12-08  8:55 ` [Bug c/25246] " jakub at gcc dot gnu dot org
2005-12-08  8:56 ` jakub at gcc dot gnu dot org
2005-12-08  8:57 ` jakub 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).