This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/61447] _Alignof returns incorrect results for some types/archs
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jun 2014 05:37:13 +0000
- Subject: [Bug c/61447] _Alignof returns incorrect results for some types/archs
- Auto-submitted: auto-generated
- References: <bug-61447-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61447
--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Rich Felker from comment #9)
> As a related issue (let me know if I should open a new PR), the following
> code:
>
> struct foo {
> char c;
> alignas(long long) long long ll;
> };
>
> is producing a wrong/nonsensical error with gcc 4.9:
>
> error: '_Alignas' specifiers cannot reduce alignment of 'll'
>
> Apparently (again) GCC wrongly internally thinks the alignment of long long
> is 8, rather than 4. With earlier gcc versions it simply gives the wrong
> alignment (8 rather than 4).
This should be already fixed: PR61053 (earlier this month I backported the fix
even to 4.9).