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

            Bug ID: 63495
           Summary: struct __attribute__ ((aligned (8))) broken on x86
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eggert at gnu dot org

Compile and run the following two-line program with an x86 target:

struct __attribute__ ((aligned (8))) s { char c; };
_Static_assert (_Alignof (struct s) >= 8, "wrong alignment");

This should compile, but here are the symptoms I observe with GCC 4.9.1:

$ gcc -m32 t.c
t.c:2:1: error: static assertion failed: "wrong alignment"
 _Static_assert (_Alignof (struct s) >= 8, "wrong alignment");
 ^

On the buggy platform the structure's alignment is 4; it should be 8.

The program compiles fine with GCC 4.8.3, so there is a regression here.  The
program also compiles fine on x86-64.

The alignment bug breaks the trunk version of GNU Emacs when built on a 32-bit
platform; see
<http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00261.html>.  I'll
try to fix Emacs to work around the bug, but the GCC bug really should get
fixed.

Reply via email to