[Bug c++/69560] x86_64: alignof(uint64_t) produces incorrect results with -m32

mh+gcc at glandium dot org gcc-bugzilla@gcc.gnu.org
Wed Jul 20 06:01:00 GMT 2016


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

Mike Hommey <mh+gcc at glandium dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mh+gcc at glandium dot org

--- Comment #12 from Mike Hommey <mh+gcc at glandium dot org> ---
(In reply to Jonathan Wakely from comment #11)
> > See Joseph's explanation at:
> > https://gcc.gnu.org/ml/gcc-patches/2013-12/msg00435.html
> 
> Which refers to 3.11 [basic.align] p2:
> 
>    The alignment required for a type might be different when it is used as
> the
>    type of a complete object and when it is used as the type of a subobject.

That doesn't seem to explain why the following is not true when compiling with
-m32:

struct foo {
  char c;
  long long l;
};

static_assert(alignof(long long) == alignof(foo), "");


More information about the Gcc-bugs mailing list