public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/63495] New: struct __attribute__ ((aligned (8))) broken on x86
@ 2014-10-09  6:13 eggert at gnu dot org
  2014-10-09  7:58 ` [Bug c/63495] " jakub at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: eggert at gnu dot org @ 2014-10-09  6:13 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2023-04-06  7:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-09  6:13 [Bug c/63495] New: struct __attribute__ ((aligned (8))) broken on x86 eggert at gnu dot org
2014-10-09  7:58 ` [Bug c/63495] " jakub at gcc dot gnu.org
2014-10-09  8:04 ` jakub at gcc dot gnu.org
2014-10-10 17:43 ` jakub at gcc dot gnu.org
2014-10-10 17:51 ` jakub at gcc dot gnu.org
2014-10-10 17:54 ` jakub at gcc dot gnu.org
2014-10-10 18:05 ` eggert at gnu dot org
2023-04-06  6:33 ` zhonghao at pku dot org.cn
2023-04-06  7:00 ` jakub at gcc dot gnu.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).