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 middle-end/24462] [4.1/4.2 Regression] packed-aligned structures are laid out differently



------- Comment #8 from jakub at gcc dot gnu dot org  2005-12-29 12:32 -------
Is this still a problem?
I certainly can't reproduce this on sparc*-linux:
struct B1_m_outer_p_inner {
  char c;
  double d;
} __attribute__ ((aligned)) __attribute__ ((packed)) s;
extern void abort (void);
int main ()
{
  char *p, *q;
  if (sizeof (struct B1_m_outer_p_inner) != 16 || __alignof__ (struct
B1_m_outer_p_inner) != 8
      || sizeof (s) != 16 || __alignof__ (s) != 8
      || __alignof__ (s.c) != 1
      || __alignof__ (s.d) != 1)
    abort ();
  p = &s.c;
  q = (char *) &s.d;
  if (q - p != 1)
    abort ();
  return 0;
}

succeeds with both GCC 3.4.x and current trunk.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


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


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