public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug d/109144] New: d: Closure fields don't get same alignment as local variable
@ 2023-03-15 13:56 ibuclaw at gcc dot gnu.org
  2023-03-16 11:36 ` [Bug d/109144] " cvs-commit at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2023-03-15 13:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109144
           Summary: d: Closure fields don't get same alignment as local
                    variable
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: d
          Assignee: ibuclaw at gdcproject dot org
          Reporter: ibuclaw at gcc dot gnu.org
  Target Milestone: ---

Between the variable declaration, and building its associated field in a
closure, the decl alignment gets lost, so this fails.

---
void main()
{
    align(128) byte var;
    assert((cast(size_t) &var) % 128 == 0);
    var = 73;
    assert((() => var)() == 73);
}

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

* [Bug d/109144] d: Closure fields don't get same alignment as local variable
  2023-03-15 13:56 [Bug d/109144] New: d: Closure fields don't get same alignment as local variable ibuclaw at gcc dot gnu.org
@ 2023-03-16 11:36 ` cvs-commit at gcc dot gnu.org
  2023-03-16 11:38 ` cvs-commit at gcc dot gnu.org
  2023-03-16 11:43 ` ibuclaw at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-16 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:46c4be98d1e759a406069487e5dbaad0346e7e7d

commit r13-6710-g46c4be98d1e759a406069487e5dbaad0346e7e7d
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Thu Mar 16 01:07:02 2023 +0100

    d: Fix closure fields don't get same alignment as local variable [PR109144]

    Local variables with both non-local references and explicit alignment
    did not propagate their alignment to either the closure field or closure
    frame type, resulting in the closure being misaligned. This is now
    correctly set-up when building the frame type.

            PR d/109144

    gcc/d/ChangeLog:

            * d-codegen.cc (build_frame_type): Set frame field and type
alignment.

    gcc/testsuite/ChangeLog:

            * gdc.dg/torture/pr109144.d: New test.

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

* [Bug d/109144] d: Closure fields don't get same alignment as local variable
  2023-03-15 13:56 [Bug d/109144] New: d: Closure fields don't get same alignment as local variable ibuclaw at gcc dot gnu.org
  2023-03-16 11:36 ` [Bug d/109144] " cvs-commit at gcc dot gnu.org
@ 2023-03-16 11:38 ` cvs-commit at gcc dot gnu.org
  2023-03-16 11:43 ` ibuclaw at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-16 11:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:2ca6dba641fa56ce70c3e1c78729389b3ed40076

commit r12-9269-g2ca6dba641fa56ce70c3e1c78729389b3ed40076
Author: Iain Buclaw <ibuclaw@gdcproject.org>
Date:   Thu Mar 16 01:07:02 2023 +0100

    d: Fix closure fields don't get same alignment as local variable [PR109144]

    Local variables with both non-local references and explicit alignment
    did not propagate their alignment to either the closure field or closure
    frame type, resulting in the closure being misaligned. This is now
    correctly set-up when building the frame type.

            PR d/109144

    gcc/d/ChangeLog:

            * d-codegen.cc (build_frame_type): Set frame field and type
alignment.

    gcc/testsuite/ChangeLog:

            * gdc.dg/torture/pr109144.d: New test.

    (cherry picked from commit 46c4be98d1e759a406069487e5dbaad0346e7e7d)

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

* [Bug d/109144] d: Closure fields don't get same alignment as local variable
  2023-03-15 13:56 [Bug d/109144] New: d: Closure fields don't get same alignment as local variable ibuclaw at gcc dot gnu.org
  2023-03-16 11:36 ` [Bug d/109144] " cvs-commit at gcc dot gnu.org
  2023-03-16 11:38 ` cvs-commit at gcc dot gnu.org
@ 2023-03-16 11:43 ` ibuclaw at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ibuclaw at gcc dot gnu.org @ 2023-03-16 11:43 UTC (permalink / raw)
  To: gcc-bugs

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

ibuclaw at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|11.0                        |12.0
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from ibuclaw at gcc dot gnu.org ---
Fix committed, and only backporting as far as gcc-12.

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

end of thread, other threads:[~2023-03-16 11:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-15 13:56 [Bug d/109144] New: d: Closure fields don't get same alignment as local variable ibuclaw at gcc dot gnu.org
2023-03-16 11:36 ` [Bug d/109144] " cvs-commit at gcc dot gnu.org
2023-03-16 11:38 ` cvs-commit at gcc dot gnu.org
2023-03-16 11:43 ` ibuclaw 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).