https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102068

            Bug ID: 102068
           Summary: [AIX] field alignment ignores packed
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dje at gcc dot gnu.org
  Target Milestone: ---
            Target: powerpc-ibm-aix*

struct __attribute__((packed, aligned(2))) S {
    double a;
    char b;
};

extern "C" int printf(const char*, ...);
int main() {
  printf("alignof %s is \t\t%lu\n","S\t",__alignof__(S));
}

GCC: S = 8
XLC: S = 2

typedef double Dbl __attribute__((__aligned__(2)));

struct S {
  Dbl d;
};

S s;

extern "C" int printf(const char*, ...);
int main() {
    printf("alignof %s is \t\t%lu\n","D\t",__alignof__(D));
    printf("alignof %s is \t\t%lu\n","S\t",__alignof__(S));
}

D = 2
GCC: S = 8
XLC: S = 2

Reply via email to