]> git.ipfire.org Git - thirdparty/gcc.git/commit
d: Fix closure fields don't get same alignment as local variable [PR109144]
authorIain Buclaw <ibuclaw@gdcproject.org>
Thu, 16 Mar 2023 00:07:02 +0000 (01:07 +0100)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 16 Mar 2023 11:06:11 +0000 (12:06 +0100)
commit46c4be98d1e759a406069487e5dbaad0346e7e7d
tree9e524f4c20331799b404f8c1707e5263c271aebe
parent63b25b8012400bed0c35d6e39549168ae131aefc
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.
gcc/d/d-codegen.cc
gcc/testsuite/gdc.dg/torture/pr109144.d [new file with mode: 0644]