public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/100935] New: d: T.alignof ignores explicit align(N) type alignment
@ 2021-06-06 21:16 ibuclaw at gdcproject dot org
  2021-06-09 18:00 ` [Bug d/100935] " cvs-commit at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ibuclaw at gdcproject dot org @ 2021-06-06 21:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100935
           Summary: d: T.alignof ignores explicit align(N) type alignment
           Product: gcc
           Version: 9.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

T.alignof currently always returns the natural alignment of a type:

align(8) struct Aligned { int a; }
static assert(Aligned.alignof == 8); // fails, 4
align(1) struct Packed { int a; }
static assert(Packed.alignof == 1);  // fails, 4

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

* [Bug d/100935] d: T.alignof ignores explicit align(N) type alignment
  2021-06-06 21:16 [Bug d/100935] New: d: T.alignof ignores explicit align(N) type alignment ibuclaw at gdcproject dot org
@ 2021-06-09 18:00 ` cvs-commit at gcc dot gnu.org
  2021-06-09 18:01 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-09 18:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain Buclaw <ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:04fea2d66bd680beb1a204e62f2f459307000813

commit r12-1344-g04fea2d66bd680beb1a204e62f2f459307000813
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Jun 9 19:37:22 2021 +0200

    d: Respect explicit align(N) type alignment (PR100935)

    It was previously the natural type alignment, defined as the maximum of
    the field alignments for an aggregate.  Make sure an explicit align(N)
    overrides it.

    Reviewed-on: https://github.com/dlang/dmd/pull/12646

    gcc/d/ChangeLog:

            PR d/100935
            * dmd/MERGE: Merge upstream dmd f3fdeb578.

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

* [Bug d/100935] d: T.alignof ignores explicit align(N) type alignment
  2021-06-06 21:16 [Bug d/100935] New: d: T.alignof ignores explicit align(N) type alignment ibuclaw at gdcproject dot org
  2021-06-09 18:00 ` [Bug d/100935] " cvs-commit at gcc dot gnu.org
@ 2021-06-09 18:01 ` cvs-commit at gcc dot gnu.org
  2021-06-09 18:03 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-09 18:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Iain Buclaw
<ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:c6c3ed60276b842114aefce54d73e30e578fdd6d

commit r11-8535-gc6c3ed60276b842114aefce54d73e30e578fdd6d
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Jun 9 19:37:22 2021 +0200

    d: Respect explicit align(N) type alignment (PR100935)

    It was previously the natural type alignment, defined as the maximum of
    the field alignments for an aggregate.  Make sure an explicit align(N)
    overrides it.

    gcc/d/ChangeLog:

            PR d/100935
            * dmd/mtype.c (Type::getProperty): Prefer explicit alignment over
            natural alignment for alignof property.

    gcc/testsuite/ChangeLog:

            PR d/100935
            * gdc.test/compilable/aggr_alignment.d: Add test cases.

    (cherry picked from commit 04fea2d66bd680beb1a204e62f2f459307000813)

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

* [Bug d/100935] d: T.alignof ignores explicit align(N) type alignment
  2021-06-06 21:16 [Bug d/100935] New: d: T.alignof ignores explicit align(N) type alignment ibuclaw at gdcproject dot org
  2021-06-09 18:00 ` [Bug d/100935] " cvs-commit at gcc dot gnu.org
  2021-06-09 18:01 ` cvs-commit at gcc dot gnu.org
@ 2021-06-09 18:03 ` cvs-commit at gcc dot gnu.org
  2021-06-09 18:04 ` cvs-commit at gcc dot gnu.org
  2021-06-09 18:06 ` ibuclaw at gdcproject dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-09 18:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain Buclaw
<ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:f7ece1a32000a9943f5bd5ac597d6ce3829aff8e

commit r10-9898-gf7ece1a32000a9943f5bd5ac597d6ce3829aff8e
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Jun 9 19:37:22 2021 +0200

    d: Respect explicit align(N) type alignment (PR100935)

    It was previously the natural type alignment, defined as the maximum of
    the field alignments for an aggregate.  Make sure an explicit align(N)
    overrides it.

    gcc/d/ChangeLog:

            PR d/100935
            * dmd/mtype.c (Type::getProperty): Prefer explicit alignment over
            natural alignment for alignof property.

    gcc/testsuite/ChangeLog:

            PR d/100935
            * gdc.test/compilable/aggr_alignment.d: Add test cases.

    (cherry picked from commit 3ba036dd1a752d29764ad44adca6e68bec9599fe)

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

* [Bug d/100935] d: T.alignof ignores explicit align(N) type alignment
  2021-06-06 21:16 [Bug d/100935] New: d: T.alignof ignores explicit align(N) type alignment ibuclaw at gdcproject dot org
                   ` (2 preceding siblings ...)
  2021-06-09 18:03 ` cvs-commit at gcc dot gnu.org
@ 2021-06-09 18:04 ` cvs-commit at gcc dot gnu.org
  2021-06-09 18:06 ` ibuclaw at gdcproject dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-09 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Iain Buclaw
<ibuclaw@gcc.gnu.org>:

https://gcc.gnu.org/g:fe555102dc224b4d946becc8a9db514ecec66161

commit r9-9575-gfe555102dc224b4d946becc8a9db514ecec66161
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Wed Jun 9 19:37:22 2021 +0200

    d: Respect explicit align(N) type alignment (PR100935)

    It was previously the natural type alignment, defined as the maximum of
    the field alignments for an aggregate.  Make sure an explicit align(N)
    overrides it.

    gcc/d/ChangeLog:

            PR d/100935
            * dmd/mtype.c (Type::getProperty): Prefer explicit alignment over
            natural alignment for alignof property.

    gcc/testsuite/ChangeLog:

            PR d/100935
            * gdc.test/compilable/aggr_alignment.d: Add test cases.

    (cherry picked from commit 3ba036dd1a752d29764ad44adca6e68bec9599fe)

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

* [Bug d/100935] d: T.alignof ignores explicit align(N) type alignment
  2021-06-06 21:16 [Bug d/100935] New: d: T.alignof ignores explicit align(N) type alignment ibuclaw at gdcproject dot org
                   ` (3 preceding siblings ...)
  2021-06-09 18:04 ` cvs-commit at gcc dot gnu.org
@ 2021-06-09 18:06 ` ibuclaw at gdcproject dot org
  4 siblings, 0 replies; 6+ messages in thread
From: ibuclaw at gdcproject dot org @ 2021-06-09 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Buclaw <ibuclaw at gdcproject dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Iain Buclaw <ibuclaw at gdcproject dot org> ---
Fix committed.

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

end of thread, other threads:[~2021-06-09 18:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06 21:16 [Bug d/100935] New: d: T.alignof ignores explicit align(N) type alignment ibuclaw at gdcproject dot org
2021-06-09 18:00 ` [Bug d/100935] " cvs-commit at gcc dot gnu.org
2021-06-09 18:01 ` cvs-commit at gcc dot gnu.org
2021-06-09 18:03 ` cvs-commit at gcc dot gnu.org
2021-06-09 18:04 ` cvs-commit at gcc dot gnu.org
2021-06-09 18:06 ` ibuclaw at gdcproject dot 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).