Files
gcc-reflection/gcc/d
Iain Buclaw 9fadadbbbc d: Fix error with -Warray-bounds and -O2 [PR117002]
The record layout of class types in D don't get any tail padding, so it
is possible for the `classInstanceSize' to not be a multiple of the
`classInstanceAlignment'.

Rather than setting the instance alignment on the underlying
RECORD_TYPE, instead give the type an alignment of 1, which will mark it
as TYPE_PACKED.  The value of `classInstanceAlignment' is instead
applied to the DECL_ALIGN of both the static `init' symbol, and the
stack allocated variable used when generating `new' for a `scope' class.

	PR d/117002

gcc/d/ChangeLog:

	* decl.cc (aggregate_initializer_decl): Set explicit decl alignment of
	class instance.
	* expr.cc (ExprVisitor::visit (NewExp *)): Likewise.
	* types.cc (TypeVisitor::visit (TypeClass *)): Mark the record type of
	classes as packed.

gcc/testsuite/ChangeLog:

	* gdc.dg/torture/pr117002.d: New test.
2025-03-31 19:15:33 +02:00
..
2025-03-31 00:17:59 +00:00
2025-03-22 10:55:13 +01:00
2025-03-22 10:55:13 +01:00
2025-03-22 10:55:13 +01:00
2025-03-30 22:13:11 +00:00

The files in the dmd subdirectory are part of the front-end for the
Digital Mars D compiler, hosted at https://github.com/dlang/dmd/.

They cover the lexical analysis, parsing, and semantic analysis of the
D Programming Language defined in the documents at https://dlang.org/.

To report a problem or look up known issues with the dmd front-end,
please visit the issue tracker at https://issues.dlang.org/.

All changes to dmd should go through the upstream repository first,
then merged back to GCC.